DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 10th October 2011
misssir misssir is offline
Real Name: zp young
New User
 
Join Date: Oct 2011
Location: fareast
Posts: 2
Thanked 0 Times in 0 Posts
Default hello, how BSD reboot but keep memory

i want to do this: before BSD reboot, my program wrote same data in memory, after reboot, my loader program read this data from memory, so i need bios not clear memory.

how can i do, have someone give me a advice? so thanks
Reply With Quote
  #2   (View Single Post)  
Old 10th October 2011
rocket357's Avatar
rocket357 rocket357 is offline
Real Name: Jonathon
Wannabe OpenBSD porter
 
Join Date: Jun 2010
Location: 127.0.0.1
Posts: 322
Thanked 9 Times in 9 Posts
Default

Umm, I'm no hardware guru, but memory clearing on reboot is pretty much a given. I've heard that you can freeze the memory immediately after reboot and forensically recover what was stored there, but it's more practical to put whatever data you need in a file on disk and have your loader read that file. That's what disks are for: non-volatile storage.
__________________
Linux Admin by Profession. OpenBSD user by choice.
Reply With Quote
  #3   (View Single Post)  
Old 10th October 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,674
Thanked 214 Times in 189 Posts
Default

Clearing RAM on a boot sequence is hardware specific. Some platforms wipe, others do not.

I have an older server that does not wipe on boot; it uses an older AMD Socket 7 motherboard. I run OpenBSD on that server, it retains any prior dmesg buffer found at boot time, just in case it may be needed.
Reply With Quote
  #4   (View Single Post)  
Old 10th October 2011
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 358
Thanked 9 Times in 8 Posts
Default

You can write your own bios and burn your own rom to do that but then each box would need their own copy of that.
Reply With Quote
  #5   (View Single Post)  
Old 10th October 2011
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by misssir View Post
i want to do this: before BSD reboot, my program wrote same data in memory, after reboot, my loader program read this data from memory, so i need bios not clear memory.

how can i do, have someone give me a advice? so thanks
Perhaps you should send it to a Non-Volatile form of storage like the disk first? "Memory" as it is commonly meant, is inherently volatile and someone tripping over the cord doesn't ask your program nicely .


Questions of how to do that in a program, are more relevant to programming (in your programming language) or unix in general.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #6   (View Single Post)  
Old 10th October 2011
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 269
Thanked 23 Times in 23 Posts
Default

Theoretically, one way of doing that would be to dump core like debugging tools do and then later create a new process and inject the appropriate parts of the core dump into it in order to rerun the program.
But I don't think there are any software available that allow you to do that.

And by the way, yes, some (many?) machines don't clear memory after a reboot. Some BIOSs clear it only when they do the "full memory check" or have the "quick POST" option disabled.
__________________
May the source be with you!

Last edited by Beastie; 10th October 2011 at 08:09 PM.
Reply With Quote
  #7   (View Single Post)  
Old 10th October 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is online now
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,068
Thanked 198 Times in 156 Posts
Default

While it may be possible after some tricks and wizardry, you have to wonder if there's not an easier way to accomplish the same end result...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #8   (View Single Post)  
Old 11th October 2011
misssir misssir is offline
Real Name: zp young
New User
 
Join Date: Oct 2011
Location: fareast
Posts: 2
Thanked 0 Times in 0 Posts
Default answer

I have changed the BSD's code in "biostramp.S", in middle of this file, I reload MBR to 0x7C00, and jmp to 0000:7C00, but my computer crashed, maybe dead in "ntldr", thus, couldn't into windows.
Reply With Quote
  #9   (View Single Post)  
Old 11th October 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

OpenBSD's MBR already relocates itself, what exactly are you trying to do? if you're attempting to have a piece of software in memory after the OpenBSD kernel loads, you'll need to modify the BIOS provided memory map to exclude that area.

After the kernel loads, you're dealing with a paged protected memory system, processes work with virtual addresses.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
reboot freebsd periodically semarmendemx FreeBSD General 3 27th October 2010 04:23 AM
Apply TTYS changes with out reboot jjjustjjjay OpenBSD General 1 6th May 2010 09:24 PM
problem to first reboot after installation openbsd OpenBSD Installation and Upgrading 3 16th May 2009 06:30 PM
Reboot loop on 7.0 upgraded to 7.1 EricM FreeBSD Installation and Upgrading 3 25th March 2009 04:25 AM
Instant reboot with 7.0-RELEASE davidgurvich FreeBSD Installation and Upgrading 5 4th June 2008 08:15 PM


All times are GMT. The time now is 03:02 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick