]> xenbits.xensource.com Git - seabios.git/commitdiff
Cleanup of fixed space addresses.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 13 Dec 2008 23:33:05 +0000 (18:33 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 13 Dec 2008 23:33:05 +0000 (18:33 -0500)
The BIOS_CONFIG_TABLE must be aligned to 1 (or gcc may change it).
Consistently use __aligned(x) wrapper throughout C code.
Register the official fixed address handlers - even if it is only a
    jump to the real handler.
Declare .type of data objects - it improves disassembler output.
Put labels at all fixed addresses - it improves disassembler output.
entry_hwirq should be calling 'cli' - use regular entry macro.
int1D is a data table, not code - so don't put an iretw there.

src/cbt.c
src/floppy_dbt.c
src/font.c
src/pirtable.c
src/post.c
src/rombios16.lds.S
src/rombios32.lds.S
src/romlayout.S

index 26744ca036e2d89c2a4db2e2bfa3d82abb94d27d..8a2a11a01a204007e8c6c6ca612d891aae959c68 100644 (file)
--- a/src/cbt.c
+++ b/src/cbt.c
@@ -27,7 +27,7 @@
 // INT 16/AH=09h (keyboard functionality) supported
 #define CBT_F2_INT1609  (1<<6)
 
-struct bios_config_table_s BIOS_CONFIG_TABLE = {
+struct bios_config_table_s BIOS_CONFIG_TABLE __aligned(1) = {
     .size     = sizeof(BIOS_CONFIG_TABLE) - 2,
     .model    = CONFIG_MODEL_ID,
     .submodel = CONFIG_SUBMODEL_ID,
index 987568bce5edc3d7401fa9f6b41989c6dd22d194..c04d2229e66a300d6db9ddebab9f987703b8f258 100644 (file)
@@ -9,7 +9,7 @@
 // Since no provisions are made for multiple drive types, most
 // values in this table are ignored.  I set parameters for 1.44M
 // floppy here
-struct floppy_dbt_s diskette_param_table __attribute__((aligned (1))) VISIBLE16 = {
+struct floppy_dbt_s diskette_param_table __aligned(1) VISIBLE16 = {
     .specify1       = 0xAF,
     .specify2       = 0x02, // head load time 0000001, DMA used
     .shutoff_ticks  = 0x25,
index 01c73ed1bb4e04f1c11378f1dabc44c4b08dce47..17f06907cab7b8143c644b16fe2f073c46497a06 100644 (file)
@@ -7,7 +7,7 @@
  * found at ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
  * This font is public domain
  */
-const u8 vgafont8[128*8] __attribute__((aligned (1))) = {
+const u8 vgafont8[128*8] __aligned(1) = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e,
     0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e,
index 705cc5032bff75b876b9b1070821a018a135d49b..8e3c3667b9af54dfebf7c5e8150875e75b500edb 100644 (file)
@@ -12,7 +12,7 @@
 struct pir_table {
     struct pir_header pir;
     struct pir_slot slots[6];
-} PACKED PIR_TABLE __attribute__((aligned(16))) = {
+} PACKED PIR_TABLE __aligned(16) = {
 #if CONFIG_PIRTABLE
     .pir = {
         .version = 0x0100,
index 31b9c2f657a0d436e51f988dedd97f1d9636df97..77c77977389c8708e0af3f948d7f04b0b4889c08 100644 (file)
@@ -54,15 +54,15 @@ init_bda()
 
     // Initialize software handlers.
     set_irq(0x10, entry_10);
-    set_irq(0x11, entry_11);
-    set_irq(0x12, entry_12);
-    set_irq(0x13, entry_13);
+    set_irq(0x11, entry_11_official);
+    set_irq(0x12, entry_12_official);
+    set_irq(0x13, entry_13_official);
     set_irq(0x14, entry_14);
     set_irq(0x15, entry_15);
     set_irq(0x16, entry_16);
     set_irq(0x17, entry_17);
     set_irq(0x18, entry_18);
-    set_irq(0x19, entry_19);
+    set_irq(0x19, entry_19_official);
     set_irq(0x1a, entry_1a);
     set_irq(0x1c, entry_1c);
     set_irq(0x40, entry_40);
index d51d69c0dc69e2ed72d47f7eb7e75d3cd4d9b639..009eb8993bb97851fe8b882aa36687a290cfd0da 100644 (file)
@@ -14,8 +14,10 @@ SECTIONS
         code16_start = . ;
         .text16 : {
                 *(.text)
+                code16_rodata = . ;
                 *(.rodata*)
                 *(.data)
+                code16_bss = . ;
                 *(.bss)
                 *(COMMON)
                 }
index 330834555c32e881767facf2d3aea4f6f9ed2bac..cc3fc36236ce7d450ab7aa8c7fe7a59a4b6206fd 100644 (file)
@@ -16,13 +16,11 @@ SECTIONS
                 *(.text)
                 code32_rodata = . ;
                 *(.rodata*)
-                code32_data = . ;
                 *(.data)
                 . = ALIGN(16) ;
-                __bss_start = . ;
+                code32_bss = . ;
                 *(.bss)
                 *(COMMON)
-                __bss_end = . ;
                 }
         code32_end = . ;
 }
index d0b463ca660299c8cb0629dcff8f117e94921c2e..e5da763c60e503990b74efde947667bd15d12b8c 100644 (file)
@@ -304,6 +304,7 @@ __call16:
         retl
 
 // Entry point when a post call looks like a resume.
+// %eax = shutdown status from cmos
 entry_resume:
         // Save old shutdown status.
         movl %eax, %ebx
@@ -393,6 +394,7 @@ permanent_halt:
 // Set base to f0000 to correspond to beginning of BIOS,
 // in case I actually define an IDT later
 // Set limit to 0
+        .type pmode_IDT_info, @object
 pmode_IDT_info:
         .word 0x0000  // limit 15:00
         .long 0xf0000 // base 16:47
@@ -402,15 +404,18 @@ pmode_IDT_info:
 // Set to typical real-mode values.
 // base  = 000000
 // limit =   03ff
+        .type rmode_IDT_info, @object
 rmode_IDT_info:
         .word 0x03ff  // limit 15:00
         .long 0       // base 16:47
 
+        .type rombios32_gdt_48, @object
 rombios32_gdt_48:
         .word (rombios32_gdt_end - rombios32_gdt)
         .long (BUILD_BIOS_ADDR + rombios32_gdt)
 
         .balign 8
+        .type rombios32_gdt, @object
 rombios32_gdt:
         .word 0, 0, 0, 0
         .word 0, 0, 0, 0
@@ -432,6 +437,7 @@ rombios32_gdt_end:
 // actually a PnP BIOS, so make sure it is *not* aligned, so OSes will
 // not see it if they scan.
         .global pnp_string
+        .type pnp_string, @object
         .balign 2
         .byte 0
 pnp_string:
@@ -463,20 +469,19 @@ pnp_string:
         ORG 0xe2c3
         IRQ_ENTRY nmi
 
-        IRQ_ENTRY_ARG 13
-        IRQ_ENTRY_ARG 12
-        IRQ_ENTRY_ARG 11
-        IRQ_ENTRY 76
-        IRQ_ENTRY 1c
-        IRQ_ENTRY 70
-
         ORG 0xe3fe
+        .global entry_13_official
+entry_13_official:
         jmp entry_13
 
         ORG 0xe401
+        .type __fdpt, @object
+__fdpt:
         // XXX - Fixed Disk Parameter Table
 
         ORG 0xe6f2
+        .global entry_19_official
+entry_19_official:
         jmp entry_19
 
         ORG 0xe6f5
@@ -484,52 +489,16 @@ pnp_string:
         .text
 
         ORG 0xe729
+        .type __brgt, @object
+__brgt:
         // XXX - Baud Rate Generator Table
 
         ORG 0xe739
         IRQ_ENTRY_ARG 14
 
-        IRQ_ENTRY 74
-        IRQ_ENTRY 75
-
-        // int 18/19 are special - they reset the stack and do not return.
-        .global entry_19
-entry_19:
-        RESET_STACK
-        pushl $_code32_handle_19
-        jmp transition32
-
-        .global entry_18
-entry_18:
-        RESET_STACK
-        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 0xe82e
         IRQ_ENTRY_ARG 16
 
-        .global entry_hwirq
-entry_hwirq:
-        ENTRY handle_hwirq
-
         ORG 0xe987
         IRQ_ENTRY 09
 
@@ -547,29 +516,78 @@ entry_hwirq:
         IRQ_ENTRY_ARG 17
 
         ORG 0xf045
-        // XXX int 10
+__int10_0x0f:
+        // XXX - INT 10 Functions 0-Fh Entry Point
         iretw
 
         ORG 0xf065
         IRQ_ENTRY_ARG 10
 
         ORG 0xf0a4
-        // XXX int 1D
-        iretw
+        .type __int1d, @object
+__int1d:
+        // XXX - INT 1D - SYSTEM DATA - VIDEO PARAMETER TABLES
+        .space 0x58
 
         .global freespace2_start, freespace2_end
 freespace2_start:
 
         ORG 0xf841
 freespace2_end:
+        .global entry_12_official
+entry_12_official:
         jmp entry_12
 
         ORG 0xf84d
+        .global entry_11_official
+entry_11_official:
         jmp entry_11
 
         ORG 0xf859
         IRQ_ENTRY_ARG 15
 
+        // Fit other misc defs if the freespace between 0xf859-0xfa6e
+
+        IRQ_ENTRY_ARG 13
+        IRQ_ENTRY_ARG 12
+        IRQ_ENTRY_ARG 11
+        IRQ_ENTRY 76
+        IRQ_ENTRY 1c
+        IRQ_ENTRY 70
+        IRQ_ENTRY 74
+        IRQ_ENTRY 75
+        IRQ_ENTRY hwirq
+
+        // int 18/19 are special - they reset the stack and do not return.
+entry_19:
+        RESET_STACK
+        pushl $_code32_handle_19
+        jmp transition32
+
+        .global entry_18
+entry_18:
+        RESET_STACK
+        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
@@ -581,11 +599,14 @@ freespace2_end:
         IRQ_ENTRY 08
 
         ORG 0xfef3
+__initvector:
         // XXX - Initial Interrupt Vector Offsets Loaded by POST
 
         ORG 0xff00
+        .type __copyright, @object
+__copyright:
         // XXX - BIOS_COPYRIGHT_STRING
-        .ascii "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team."
+        .asciz "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team."
 
         ORG 0xff53
         .global dummy_iret_handler
@@ -601,13 +622,18 @@ reset_vector:
         ljmpw $SEG_BIOS, $post16
 
         ORG 0xfff5
+        .type __biosdate, @object
+__biosdate:
         // BIOS build date
         .ascii "06/23/99"
 
         ORG 0xfffe
+        .type __model_id, @object
+__model_id:
         .byte CONFIG_MODEL_ID
 
         .global bios_checksum
+        .type bios_checksum, @object
 bios_checksum:
         .byte 0x00