pushl %eax
// Jump to 16bit mode
- ljmp $0x20, $1f
+ ljmp $REAL_MODE_CS, $1f
.code16gcc
1:
// restore data segment limits to 0xffff
- movw $0x28, %ax
+ movw $REAL_MODE_DS, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss
pushfw
pushl %eax
movl 0x06(%esp), %eax
- movl %ecx, 0x1c(%eax) // Save %ecx
+ movl %ecx, %ss:0x1c(%eax) // Save %ecx
+ movw %ss, %cx
+ movw %cx, %ds // Restore %ds == %ss
popl %ecx
- movl %ecx, 0x20(%eax) // Save %eax
+ movl %ecx, 0x20(%eax) // Save %eax
popw %cx
- movw %cx, 0x28(%eax) // Save flags
+ movw %cx, 0x28(%eax) // Save flags
// Store remaining registers
movw %es, 0x02(%eax)
.word rombios32_gdt
.word 0x000f
+ .balign 8
rombios32_gdt:
.word 0, 0, 0, 0
.word 0, 0, 0, 0
// 16 bit data segment base=0x0 limit=0xffff (REAL_MODE_DS)
.word 0xffff, 0, 0x9300, 0x0000
-// We need a copy of this string, but we are not actually a PnP BIOS,
-// so make sure it is *not* aligned, so OSes will not see it if they
-// scan.
- .align 2
- .byte 0
- .globl pnp_string
-pnp_string:
- .ascii "$PnP"
-
/****************************************************************
* Interrupt entry points
****************************************************************/
.macro ENTRY cfunc
- cli // In case something far-calls insted of using "int"
pushal
pushw %es
pushw %ds
.macro IRQ_ENTRY num
.globl entry_\num
entry_\num :
+ cli // In case something far-calls instead of using "int"
ENTRY handle_\num
iretw
.endm
- .macro IRQ_TRAMPOLINE num
- .globl irq_trampoline_0x\num
- irq_trampoline_0x\num :
- int $0x\num
+ // APM trampolines
+ .globl apm16protected_entry
+apm16protected_entry:
+ pushfw // save flags
+ pushl %eax // dummy
+ ENTRY handle_1553
+ addw $4, %sp // pop dummy
+ popfw // restore flags
+ lretw
+
+ .code32
+ .globl apm32protected_entry
+apm32protected_entry:
+ pushfw // save flags
+ pushw %cs // Setup for long jump to 16bitmode
+ incw (%esp)
+ pushw 1f
+ lcallw *(%esp)
+ addl $4, %esp // pop call address
+ popfw
+ lretl
+ .code16gcc
+1: // 16bit entry point for apm32 code.
+ ENTRY handle_1553
lretw
- .endm
.org 0xe2c3
IRQ_ENTRY nmi
RESET_STACK
calll handle_18
+
+ // IRQ trampolines
+ .macro IRQ_TRAMPOLINE num
+ .globl irq_trampoline_0x\num
+ irq_trampoline_0x\num :
+ int $0x\num
+ lretw
+ .endm
+
IRQ_TRAMPOLINE 02
IRQ_TRAMPOLINE 10
IRQ_TRAMPOLINE 13
IRQ_ENTRY 0e
.org 0xefc7
- // XXX - Diskette Controller Parameter Table
+.include "out/floppy_dbt.proc.16.s"
+ .text
.org 0xefd2
IRQ_ENTRY 17
.ascii "06/23/99"
.org 0xfffe
- // model byte 0xFC = AT
- .byte 0xfc
+ .byte CONFIG_MODEL_ID
.byte 0x00
.end