Skip to content

Commit a333010

Browse files
committed
Add a basic Readme with build instructions
1 parent 226e55d commit a333010

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

real_mode/first_stage/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# First Stage: Bootsector
2+
3+
This executable needs to fit into the 512-byte boot sector, so we need to use all kinds of tricks to keep the size down.
4+
5+
## Build Commands
6+
7+
1. `cargo build --release -Zbuild-std=core --target x86-16bit.json -Zbuild-std-features=compiler-builtins-mem`
8+
2. `objcopy -I elf32-i386 -O binary target/x86-16bit/release/first_stage target/disk_image.bin
9+
10+
To run in QEMU:
11+
12+
- `qemu-system-x86_64 -drive format=raw,file=target/disk_image.bin`
13+
14+
To print the contents of the ELF file, e.g. for trying to bring the size down:
15+
16+
- `objdump -xsdS -M i8086,intel target/x86-16bit/release/first_stage`

0 commit comments

Comments
 (0)