aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-01-17 15:17:34 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-01-17 15:17:34 -0500
commit711ddc64ac67b7971aa151c6695e98e31dc4c404 (patch)
treef02d647c9e8f007ec28acb08a1a22730ce759ddc /src
parent202024a27b171700f95717a6ef9c23bcf04d9fc1 (diff)
downloadseabios-hppa-711ddc64ac67b7971aa151c6695e98e31dc4c404.zip
seabios-hppa-711ddc64ac67b7971aa151c6695e98e31dc4c404.tar.gz
seabios-hppa-711ddc64ac67b7971aa151c6695e98e31dc4c404.tar.bz2
Try to automatically fit sections into open spaces in the fixed area.
Enhance layoutrom.py script to find and locate sections into fixed area. Have layoutrom.py create output file instead of using redirect from make. Don't use freespace2 for bios tables in f segment - freespace in fixed area is now automatically filled. Change checkrom script to test final_code16_end instead of _start - this improves catching of alignment errors. Don't align gdt to 8 bytes - it causes whole section to be aligned, which causes entry point to be misaligned. Explicitly reserve space for variables in fixed area so that the space for them is not auto-filled.
Diffstat (limited to 'src')
-rw-r--r--src/memmap.c10
-rw-r--r--src/rombios.lds.S2
-rw-r--r--src/rombios16.lds.S1
-rw-r--r--src/romlayout.S9
4 files changed, 11 insertions, 11 deletions
diff --git a/src/memmap.c b/src/memmap.c
index 372ec52..01b00d8 100644
--- a/src/memmap.c
+++ b/src/memmap.c
@@ -123,7 +123,7 @@ add_e820(u64 start, u64 size, u32 type)
}
// Symbols defined in romlayout.S
-extern char freespace2_start, freespace2_end;
+extern char freespace1_start, freespace1_end;
u32 bios_table_cur_addr, bios_table_end_addr;
@@ -131,8 +131,8 @@ u32 bios_table_cur_addr, bios_table_end_addr;
void
memmap_setup()
{
- bios_table_cur_addr = (u32)&freespace2_start;
- bios_table_end_addr = (u32)&freespace2_end;
+ bios_table_cur_addr = (u32)&freespace1_start;
+ bios_table_end_addr = (u32)&freespace1_end;
dprintf(1, "bios_table_addr: 0x%08x end=0x%08x\n",
bios_table_cur_addr, bios_table_end_addr);
@@ -155,8 +155,8 @@ memmap_finalize()
dprintf(1, "final bios_table_addr: 0x%08x (used %d%%)\n"
, bios_table_cur_addr
- , (100 * (bios_table_cur_addr - (u32)&freespace2_start)
- / ((u32)&freespace2_end - (u32)&freespace2_start)));
+ , (100 * (bios_table_cur_addr - (u32)&freespace1_start)
+ / ((u32)&freespace1_end - (u32)&freespace1_start)));
if (bios_table_cur_addr > bios_table_end_addr)
BX_PANIC("bios_table_end_addr overflow!\n");
}
diff --git a/src/rombios.lds.S b/src/rombios.lds.S
index c17d0f0..61a04c4 100644
--- a/src/rombios.lds.S
+++ b/src/rombios.lds.S
@@ -15,8 +15,8 @@ SECTIONS
*(.text)
. = code16_start ;
- final_code16_start = . ;
*(.text16)
+ final_code16_end = . ;
}
/DISCARD/ : { *(.discard*) }
}
diff --git a/src/rombios16.lds.S b/src/rombios16.lds.S
index 074d5f1..61de421 100644
--- a/src/rombios16.lds.S
+++ b/src/rombios16.lds.S
@@ -11,6 +11,7 @@ OUTPUT_ARCH("i386")
SECTIONS
{
. = ( _code32_code32_end - BUILD_BIOS_ADDR ) ;
+ . = ALIGN(16) ;
code16_start = . ;
.text16 : {
diff --git a/src/romlayout.S b/src/romlayout.S
index 4db9dfe..e8cc9b4 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -487,7 +487,7 @@ rombios32_gdt_48:
.word (rombios32_gdt_end - rombios32_gdt)
.long (BUILD_BIOS_ADDR + rombios32_gdt)
- .balign 8
+ //.balign 8
.type rombios32_gdt, @object
rombios32_gdt:
.word 0, 0, 0, 0
@@ -520,6 +520,7 @@ entry_13_official:
.type __fdpt, @object
__fdpt:
// XXX - Fixed Disk Parameter Table
+ .space 16
ORG 0xe6f2
.global entry_19_official
@@ -534,6 +535,7 @@ entry_19_official:
.type __brgt, @object
__brgt:
// XXX - Baud Rate Generator Table
+ .space 16
ORG 0xe739
IRQ_ENTRY_ARG 14
@@ -571,11 +573,7 @@ __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
@@ -626,6 +624,7 @@ entry_18:
ORG 0xfef3
__initvector:
// XXX - Initial Interrupt Vector Offsets Loaded by POST
+ .space 13
ORG 0xff00
.type __copyright, @object