Direct writing to the IDE on panic?
Hi,
I was wondering if anyone has done some work to directly write and poll to the IDE? This is to store data on a panic or oops. So it would need to bypass pretty much all the normal Linux mechanisms to do low lever IDE work.
So lets say we have a special partition on a hard drive to be reserved for just this purpose. Even set it up to be a swap partition. So on a system crash, turn off interrupts, stop all other processors, and then through polling (to avoid interrupt handling), write as much data as possible about the state of the machine to this special partition. After a reboot, this data can then be retrieved for review to see why the system crashed.
Obviously, this would be a slow process, but the system has crashed and we care more about retrieving information than speed.
Has this already been done and what issues need to be addressed?
Thanks,
-- Steve
Quoted 6 lines · Steven Rostedt
Hi,
I was wondering if anyone has done some work to directly write and poll to the IDE? This is to store data on a panic or oops. So it would need to bypass pretty much all the normal Linux mechanisms to do low lever IDE work.
I've seen some 2.4 work here. For 2.6 the current focus is kexec of course
Quoted 4 lines
Obviously, this would be a slow process, but the system has crashed and we care more about retrieving information than speed.
Has this already been done and what issues need to be addressed?
The big issue is 'how am I sure the partition data and code I run are valid post crash'. You don't want the risk of dumping to the wrong part of the disk and making a crash into a disaster.
Quoted 5 lines · Alan Cox
The big issue is 'how am I sure the partition data and code I run are valid post crash'. You don't want the risk of dumping to the wrong part of the disk and making a crash into a disaster.
Nice point. But fortunately, this is for a custom application running on an embedded device, such that the data that is on another part of the disk (which btw is an IDE flash) is just the application and the rest of the OS. So, although a bad write to the disk will cause much more work, it wont destroy data that cant be replaced.
Thanks,
-- Steve
Quoted 5 lines · Steven Rostedt
Nice point. But fortunately, this is for a custom application running on an embedded device, such that the data that is on another part of the disk (which btw is an IDE flash) is just the application and the rest of the OS. So, although a bad write to the disk will cause much more work, it wont destroy data that cant be replaced.
If you know the controller as well then you are correct in assuming the code to do the dump is very simple indeed providing you stick to PIO, especially if you know the set up is already done before crash
Quoted 11 lines · Alan Cox
Quoted 5 lines · Steven Rostedt
Nice point. But fortunately, this is for a custom application running on an embedded device, such that the data that is on another part of the disk (which btw is an IDE flash) is just the application and the rest of the OS. So, although a bad write to the disk will cause much more work, it wont destroy data that cant be replaced.
If you know the controller as well then you are correct in assuming the code to do the dump is very simple indeed providing you stick to PIO, especially if you know the set up is already done before crash
Thank you very much for your input Alan!
Now my strength in IDE is not that strong, hence the reason I was asking if this was done before. I'd like to look at some examples before I go ahead and figure it out on my own. I'm sure that I'm going to need to do a rewrite for our specific configuration, but looking at others work might make things easier.
Since this is all under GPL (my customer will give all the source to who ever they distribute it to), I was hoping to take advantage of free software here and not completely reinvent the wheel (and destroying it along the way ;)
Thanks,
-- Steve
Quoted 23 lines · On Fri, 14 Apr 2006 10:54:19 -0400 (EDT) Steven Rostedt wrote:
Quoted 11 lines · Alan Cox
Quoted 5 lines · Steven Rostedt
Nice point. But fortunately, this is for a custom application running on an embedded device, such that the data that is on another part of the disk (which btw is an IDE flash) is just the application and the rest of the OS. So, although a bad write to the disk will cause much more work, it wont destroy data that cant be replaced.
If you know the controller as well then you are correct in assuming the code to do the dump is very simple indeed providing you stick to PIO, especially if you know the set up is already done before crash
Thank you very much for your input Alan!
Now my strength in IDE is not that strong, hence the reason I was asking if this was done before. I'd like to look at some examples before I go ahead and figure it out on my own. I'm sure that I'm going to need to do a rewrite for our specific configuration, but looking at others work might make things easier.
Quoted 4 lines
Since this is all under GPL (my customer will give all the source to who ever they distribute it to), I was hoping to take advantage of free software here and not completely reinvent the wheel (and destroying it along the way ;)
Rusty Russell had an IDE block dump patch during the 2.4 timeframe IIRC. I don't know where it could be found now. Maybe in old LKCD tarballs or archives?
---
~Randy
Quoted 4 lines · Randy.Dunlap
O
Rusty Russell had an IDE block dump patch during the 2.4 timeframe IIRC. I don't know where it could be found now. Maybe in old LKCD tarballs or archives?
Hi Randy,
Thanks for the tip. Is this what you are talking about?
http://marc.theaimsgroup.com/?l=linux-kernel&m=103217825112169&w=2
-- Steve
Quoted 11 lines · On Sat, 15 Apr 2006 11:05:05 -0400 Steven Rostedt wrote:
Quoted 4 lines · Randy.Dunlap
O
Rusty Russell had an IDE block dump patch during the 2.4 timeframe IIRC. I don't know where it could be found now. Maybe in old LKCD tarballs or archives?Hi Randy,
Thanks for the tip. Is this what you are talking about?
http://marc.theaimsgroup.com/?l=linux-kernel&m=103217825112169&w=2
Yes, that's it. Thanks for the URL.
---
~Randy