Erik Jensen
2011-Oct-21 18:37 UTC
[syslinux] Modify memdisk to mask/overlay start of hard drive
I have a somewhat unique problem I am trying to solve that requires me to temporarily replace the first 63s of the main hard drive and boot the result. Basically, I am hoping it is possible to modify memdisk to serve requests for the first 63 sectors from a ram disk and pass other requests through to the hard drive. There will never be a read spanning the two, so I don't need it to be able to handle that complexity. Also, it will alway be masking the first 63s of the first hard drive, so it doesn't need to be configurable. How complicated would it be to modify memdisk to support this? Any advice on where to make the change? I do have some programming experience, but none in assembly. Thanks.
Alexander Foken
2011-Oct-22 20:20 UTC
[syslinux] Modify memdisk to mask/overlay start of hard drive
On 10/21/2011 08:37 PM, Erik Jensen wrote:> I have a somewhat unique problem I am trying to solve that requires me > to temporarily replace the first 63s of the main hard drive and boot > the result. Basically, I am hoping it is possible to modify memdisk to > serve requests for the first 63 sectors from a ram disk and pass other > requests through to the hard drive. There will never be a read > spanning the two, so I don't need it to be able to handle that > complexity. Also, it will alway be masking the first 63s of the first > hard drive, so it doesn't need to be configurable. > > How complicated would it be to modify memdisk to support this? Any > advice on where to make the change? I do have some programming > experience, but none in assembly. > > ThanksThat highly depends on the operating system that accesses the harddisk. DOS uses BIOS INT 0x13 (see <URL:http://www.ctyme.com/intr/int-13.htm>), so installing your own INT 0x13 handler or hacking the one installed by memdisk should be sufficient. Other systems like Linux, *BSD, Windows, install their own set of drivers once the system has been loaded. For those systems, you would need to install a modified INT 0x13 handler for the boot phase, and a modified system-specific driver once the system switches to its own drivers. Alexander
H. Peter Anvin
2011-Oct-24 09:15 UTC
[syslinux] Modify memdisk to mask/overlay start of hard drive
On 10/21/2011 08:37 PM, Erik Jensen wrote:> I have a somewhat unique problem I am trying to solve that requires me > to temporarily replace the first 63s of the main hard drive and boot > the result. Basically, I am hoping it is possible to modify memdisk to > serve requests for the first 63 sectors from a ram disk and pass other > requests through to the hard drive. There will never be a read > spanning the two, so I don't need it to be able to handle that > complexity. Also, it will alway be masking the first 63s of the first > hard drive, so it doesn't need to be configurable. > > How complicated would it be to modify memdisk to support this? Any > advice on where to make the change? I do have some programming > experience, but none in assembly. >It would be worthwhile, perhaps, to describe your use case. -hpa