-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on second stage #481
Comments
create_mbr_disk inserts padding as necessary to write it to the right location on the disk. And the first stage then loads a fixed sector on the disk to a fixed address in ram. |
So I can't just write bytes at the second sector? |
Looks like the second stage is actually written to the second sector: Line 31 in 086c248
|
Yep! Because the linker script fills with 00 and 55aa at the 511 and 512 bytes |
https://github.com/boredcoder411/rust_boot |
I've read the through the first bootsector's code, and everything looks good with objdump: _second_stage_start label is supposed to be at ram 0x7e00 and the code calls it, but I'm trying to make my own second stage and don't understand just how the second stage is placed after the first one. I've tried assembling a program with nasm -f bin and just cat appending to the original file, but that doesn't seem to work, even if the new code is at offset 0x7e00. Am I missing something?
The text was updated successfully, but these errors were encountered: