- 论坛徽章:
- 0
|
本帖最后由 yylogo 于 2010-08-02 09:48 编辑
回复 4# openspace
没用额..
代码如下:- BOOTSEG = 0x07C0
- SYSSEG = 0x0000
- SYSLEN = 17
- .code16
- .text
- .global _start, load_system, die, ok_lode, idt_48, gdt_48, gdt
- _start:
- movw $BOOTSEG, %ax
- movw %ax, %cs
- movw %ax, %ds
- movw %ax, %ss
- movw $0x400, %sp
- load_system:
- movw $0x0000, %dx
- movw $0x0002, %cx
- movw $SYSSEG, %ax
- movw %es, %ax
- xor %bx, %bx
- movw $0x200+SYSLEN, %ax
- int $0x13
- jnc ok_lode
- die: jmp die
- ok_lode:
- lidt idt_48
- lgdt gdt_48
- iret
- .data
- idt_48: .word 0, 0, 0
- gdt: .word 0, 0, 0, 0
- .word 0x07FF
- .word 0x0000
- .word 0x9A00
- .word 0x00C0
- .word 0x07FF
- .word 0x0000
- .word 0x9200
- .word 0x00C0
- gdt_48: .word 0x7ff, 0x07c0+gdt, 0
- .org 510
- .word 0xAA55
复制代码 提示如下:
yylogo@ubuntu:~$ as boot.s -o boot.o
yylogo@ubuntu:~$ ld boot.o -o boot
boot.o: In function `ok_lode':
(.text+0x2 : relocation truncated to fit: R_X86_64_16 against symbol `idt_48' d
efined in .data section in boot.o
boot.o: In function `ok_lode':
(.text+0x2d): relocation truncated to fit: R_X86_64_16 against symbol `gdt_48' d
efined in .data section in boot.o
boot.o: In function `gdt_48':
(.data+0x20): relocation truncated to fit: R_X86_64_16 against symbol `gdt' defi
ned in .data section in boot.o |
|