root / pc-bios / linux_boot.S @ 3e11db9a
History | View | Annotate | Download (521 Bytes)
1 | 07ce05ea | bellard | /* |
---|---|---|---|
2 | 07ce05ea | bellard | * QEMU Boot sector to launch a preloaded Linux kernel |
3 | 07ce05ea | bellard | * Copyright (c) 2004 Fabrice Bellard |
4 | 07ce05ea | bellard | */ |
5 | 07ce05ea | bellard | |
6 | 07ce05ea | bellard | #define LOAD_SEG 0x9000 |
7 | 07ce05ea | bellard | |
8 | 07ce05ea | bellard | .code16 |
9 | 07ce05ea | bellard | .text |
10 | a735aa31 | bellard | .globl _start |
11 | 07ce05ea | bellard | |
12 | a735aa31 | bellard | _start: |
13 | 07ce05ea | bellard | cli |
14 | 07ce05ea | bellard | cld |
15 | 07ce05ea | bellard | mov $LOAD_SEG, %ax |
16 | 07ce05ea | bellard | mov %ax, %ds |
17 | 07ce05ea | bellard | mov %ax, %es |
18 | 07ce05ea | bellard | mov %ax, %fs |
19 | 07ce05ea | bellard | mov %ax, %gs |
20 | 07ce05ea | bellard | mov %ax, %ss |
21 | 07ce05ea | bellard | mov $0x8ffe, %sp |
22 | 07ce05ea | bellard | ljmp $LOAD_SEG + 0x20, $0 |
23 | 07ce05ea | bellard | |
24 | 07ce05ea | bellard | 1: |
25 | a735aa31 | bellard | .fill 510 - (1b - _start), 1, 0 |
26 | 07ce05ea | bellard | |
27 | 07ce05ea | bellard | /* boot sector signature */ |
28 | 07ce05ea | bellard | .byte 0x55 |
29 | 07ce05ea | bellard | .byte 0xaa |