This assumes your that 'sda' is the correct block device. Nasm ~/windows_bootloader.asm -f bin ~/modified_bootloader.binĭd if=~/modified_bootloader.bin of=/dev/sda bs=512 count=1 Ndisasm -b16 -o7C00h ~/windows_bootloader.bin > ~/windows_bootloader.asm I personally just boot under linux and use dd:ĭd if=/dev/sda of=~/windows_bootloader.bin bs=512 count=1 There are various ways of writing to the boot sector of a drive, and there is a general reference I used back when I was experimenting with homebrew OS development: How would you suggest I write instructions into the MBR ? Is maybe booting a live CD of *nix and writing to the MBR from there ? My QUESTION is what's the best way to put an instruction in the MBR ? It goes without saying Windows doesn't allow direct access to the disk. I am well aware that this is going to be difficult. Basically I figure I'll insert a call and leave the rest of the MBR alone. Is it better to slave HDD_1 into another machine and then write to it, or write to it directly (outside of windows) in the current machine. My question is what's the best way to write into the MBR ? If I want to alter the MBR of lets say disk HDD_1. I fully understand that this will need to be written in Assembly and given the 446 bytes or so of code space in the MBR I just expect to call other code outside of the MBR. Basically I need the ability to execute code on the HDD before, the OS starts up and takes over. I am an electrical engineer who has recently discovered the need to modify the code in the MBR.
0 Comments
Leave a Reply. |