# Now in 32-bit protected mode.\r
##############################################################################\r
\r
- .486: \r
- #.MODEL flat\r
- .stack: \r
- .code:\r
.org 0x21000\r
\r
+.global _start\r
+_start:\r
+\r
.equ DEFAULT_HANDLER_SIZE, INT1 - INT0\r
\r
.macro jmpCommonIdtEntry \r
# be done to maintain the consistency of the size\r
# of entry points...\r
.byte 0xe9 # jmp 16 bit relative\r
- .long commonIdtEntry - . - 4 # A problem \r
+ .long commonIdtEntry - . - 4 # offset to jump to \r
.endm\r
\r
Start: \r
movl (Idtr + 2), %esi\r
movl (%esi), %edi\r
\r
-LOOP_1: # loop through all IDT entries exception handlers and initialize to default handler\r
+LOOP_1: # loop through all IDT entries exception handlers and initialize to default handler\r
movw %bx, (%edi) # write bits 15..0 of offset\r
movw $0x20, 2(%edi) # SYS_CODE_SEL from GDT\r
- movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present\r
+ movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present\r
movw %ax, 6(%edi) # write bits 31..16 of offset\r
addl $8, %edi # move up to next descriptor\r
addw DEFAULT_HANDLER_SIZE, %bx # move to next entry point\r
cmpw $0, %bx\r
jne SectionLoop\r
\r
- movzwl Idtr, %eax # get size of IDT\r
+ movzwl (Idtr), %eax # get size of IDT\r
incl %eax\r
- addl Idtr + 2, %eax # add to base of IDT to get location of memory map... \r
+ addl (Idtr + 2), %eax # add to base of IDT to get location of memory map... \r
pushl %eax # push memory map location on stack for call to EFILDR...\r
\r
pushl %eax # push return address (useless, just for stack balance)\r
ret\r
\r
# db "**** DEFAULT IDT ENTRY ***",0\r
- .align 0x2\r
+ .p2align 1\r
Halt: \r
INT0: \r
pushl $0x0 # push error code place holder on the stack\r
pushl %eax\r
pushl %ecx\r
\r
- movb ' ', %al\r
+ movb $0x00, %al\r
movb $0xc, %ah\r
movl $0xb8000, %edi\r
movl $80*24, %ecx\r