From c5b503606b8835a9d3f2a6f323100938e146761d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 18 Dec 2008 21:56:41 -0500 Subject: [PATCH] Make sure %ss==%ds in resume handler call. Also, rearrange the layout in the fixed area to make more room in post area. --- src/romlayout.S | 90 ++++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/src/romlayout.S b/src/romlayout.S index e5da763..1391a81 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -318,7 +318,9 @@ entry_resume: // Use a stack in EBDA movw $SEG_BDA, %ax movw %ax, %ds - movw BDA_ebda_seg, %ss + movw BDA_ebda_seg, %ax + movw %ax, %ss + movw %ax, %ds movl $EBDA_resume_stack_top, %esp // Call handler. @@ -380,9 +382,52 @@ permanent_halt: 1: hlt jmp 1b + // IRQ trampolines + .macro IRQ_TRAMPOLINE num + .global irq_trampoline_0x\num + irq_trampoline_0x\num : + int $0x\num + lretw + .endm + + IRQ_TRAMPOLINE 02 + IRQ_TRAMPOLINE 10 + IRQ_TRAMPOLINE 13 + IRQ_TRAMPOLINE 15 + IRQ_TRAMPOLINE 16 + IRQ_TRAMPOLINE 18 + IRQ_TRAMPOLINE 19 + IRQ_TRAMPOLINE 1c + IRQ_TRAMPOLINE 4a + /**************************************************************** - * GDT and IDT tables + * Interrupt entry points + ****************************************************************/ + + // Define an entry point for an interrupt (no args passed). + .macro IRQ_ENTRY num + .global entry_\num + entry_\num : + cli // In case something far-calls instead of using "int" + ENTRY handle_\num + iretw + .endm + + // Define an entry point for an interrupt (can read/modify args). + .macro IRQ_ENTRY_ARG num + .global entry_\num + entry_\num : + cli // In case something far-calls instead of using "int" + ENTRY_ARG handle_\num + iretw + .endm + + ORG 0xe2c3 + IRQ_ENTRY nmi + +/**************************************************************** + * GDT and IDT tables (between 0xe2c3 - 0xe3fe) ****************************************************************/ // Protected mode IDT descriptor @@ -445,30 +490,9 @@ pnp_string: /**************************************************************** - * Interrupt entry points + * Interrupt entry points (continued) ****************************************************************/ - // Define an entry point for an interrupt (no args passed). - .macro IRQ_ENTRY num - .global entry_\num - entry_\num : - cli // In case something far-calls instead of using "int" - ENTRY handle_\num - iretw - .endm - - // Define an entry point for an interrupt (can read/modify args). - .macro IRQ_ENTRY_ARG num - .global entry_\num - entry_\num : - cli // In case something far-calls instead of using "int" - ENTRY_ARG handle_\num - iretw - .endm - - ORG 0xe2c3 - IRQ_ENTRY nmi - ORG 0xe3fe .global entry_13_official entry_13_official: @@ -570,24 +594,6 @@ entry_18: pushl $_code32_handle_18 jmp transition32 - // IRQ trampolines - .macro IRQ_TRAMPOLINE num - .global irq_trampoline_0x\num - irq_trampoline_0x\num : - int $0x\num - lretw - .endm - - IRQ_TRAMPOLINE 02 - IRQ_TRAMPOLINE 10 - IRQ_TRAMPOLINE 13 - IRQ_TRAMPOLINE 15 - IRQ_TRAMPOLINE 16 - IRQ_TRAMPOLINE 18 - IRQ_TRAMPOLINE 19 - IRQ_TRAMPOLINE 1c - IRQ_TRAMPOLINE 4a - ORG 0xfa6e .include "out/font.proc.16.s" .text -- 2.39.5