aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2008-07-21 22:23:05 -0400
committerKevin O'Connor <kevin@koconnor.net>2008-07-21 22:23:05 -0400
commit409670204b5da474d558444c7c4f9defe0242815 (patch)
treec4903a409ff451ea9b77d9cf2a890ddcaa13a390
parentae8be531d7a0f04666b51bb6a8b78b6a956efcaf (diff)
downloadseabios-hppa-409670204b5da474d558444c7c4f9defe0242815.zip
seabios-hppa-409670204b5da474d558444c7c4f9defe0242815.tar.gz
seabios-hppa-409670204b5da474d558444c7c4f9defe0242815.tar.bz2
Add additional config options to remove parts of code.
Added options CONFIG_BOOT, CONFIG_SERIAL, CONFIG_LPT, CONFIG_KEYBOARD, CONFIG_BOOTMENU. Also extended coverage of existing options to ensure full code got removed.
-rw-r--r--src/boot.c3
-rw-r--r--src/config.h16
-rw-r--r--src/floppy.c12
-rw-r--r--src/kbd.c7
-rw-r--r--src/mouse.c3
-rw-r--r--src/post.c5
-rw-r--r--src/post_menu.c3
-rw-r--r--src/serial.c14
-rw-r--r--src/smm.c2
9 files changed, 64 insertions, 1 deletions
diff --git a/src/boot.c b/src/boot.c
index b090058..3efa9b6 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -77,6 +77,9 @@ print_boot_failure(u16 type, u8 reason)
static void
try_boot(u16 seq_nr)
{
+ if (! CONFIG_BOOT)
+ BX_PANIC("Boot support not compiled in.\n");
+
SET_EBDA(ipl.sequence, seq_nr);
u32 bootdev = GET_EBDA(ipl.bootorder);
diff --git a/src/config.h b/src/config.h
index 596df24..745a996 100644
--- a/src/config.h
+++ b/src/config.h
@@ -22,9 +22,13 @@
// Send debugging information to serial port
#define CONFIG_DEBUG_SERIAL 0
+// Support for int13 floppy drive access
#define CONFIG_FLOPPY_SUPPORT 1
+// Support for int15c2 mouse calls
#define CONFIG_PS2_MOUSE 1
+// Support for IDE disk code
#define CONFIG_ATA 1
+// Support calling int155f on each keyboard press
#define CONFIG_KBD_CALL_INT15_4F 1
// Support for booting from a CD
#define CONFIG_CDROM_BOOT 1
@@ -34,6 +38,16 @@
#define CONFIG_PCIBIOS 1
// Support int 15/53 APM BIOS calls
#define CONFIG_APMBIOS 1
+// Support int 19/18 system bootup support
+#define CONFIG_BOOT 1
+// Support int 14 parallel port calls
+#define CONFIG_SERIAL 1
+// Support int 17 parallel port calls
+#define CONFIG_LPT 1
+// Support int 16 keyboard calls
+#define CONFIG_KEYBOARD 1
+// Support an interactive boot menu at end of post.
+#define CONFIG_BOOTMENU 1
// Support generation of a PIR table in 0xf000 segment (for emulators)
#define CONFIG_PIRTABLE 1
@@ -41,6 +55,8 @@
#define CONFIG_MPTABLE 1
// Support generation of ACPI tables (for emulators)
#define CONFIG_ACPI 1
+// Support bios callbacks specific to via vgabios.
+#define CONFIG_VGAHOOKS 1
/* define it if the (emulated) hardware supports SMM mode */
#define CONFIG_USE_SMM 1
diff --git a/src/floppy.c b/src/floppy.c
index 6e903ad..a42f53f 100644
--- a/src/floppy.c
+++ b/src/floppy.c
@@ -20,6 +20,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
+#if MODE16 == 1
struct floppy_ext_dbt_s diskette_param_table2 VISIBLE16 = {
.dbt = {
.specify1 = 0xAF,
@@ -38,6 +39,7 @@ struct floppy_ext_dbt_s diskette_param_table2 VISIBLE16 = {
.data_rate = 0, // data transfer rate
.drive_type = 4, // drive type in cmos
};
+#endif
void
floppy_drive_setup()
@@ -739,6 +741,9 @@ void VISIBLE16
handle_0e()
{
debug_isr(DEBUG_ISR_0e);
+ if (! CONFIG_FLOPPY_SUPPORT)
+ goto done;
+
if ((inb(PORT_FD_STATUS) & 0xc0) != 0xc0) {
outb(0x08, PORT_FD_DATA); // sense interrupt status
while ((inb(PORT_FD_STATUS) & 0xc0) != 0xc0)
@@ -747,15 +752,20 @@ handle_0e()
inb(PORT_FD_DATA);
} while ((inb(PORT_FD_STATUS) & 0xc0) == 0xc0);
}
- eoi_pic1();
// diskette interrupt has occurred
SETBITS_BDA(floppy_recalibration_status, FRS_TIMEOUT);
+
+done:
+ eoi_pic1();
}
// Called from int08 handler.
void
floppy_tick()
{
+ if (! CONFIG_FLOPPY_SUPPORT)
+ return;
+
// time to turn off drive(s)?
u8 fcount = GET_BDA(floppy_motor_counter);
if (fcount) {
diff --git a/src/kbd.c b/src/kbd.c
index b47b3ca..f4a1c95 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -92,6 +92,9 @@ kbd_setup()
SET_BDA(kbd_buf_end_offset
, x + FIELD_SIZEOF(struct bios_data_area_s, kbd_buf));
+ if (! CONFIG_KEYBOARD)
+ return;
+
keyboard_init();
// Enable IRQ1 (handle_09)
@@ -306,6 +309,8 @@ void VISIBLE16
handle_16(struct bregs *regs)
{
debug_enter(regs, DEBUG_HDL_16);
+ if (! CONFIG_KEYBOARD)
+ return;
irq_enable();
@@ -616,6 +621,8 @@ void VISIBLE16
handle_09()
{
debug_isr(DEBUG_ISR_09);
+ if (! CONFIG_KEYBOARD)
+ goto done;
// read key from keyboard controller
u8 v = inb(PORT_PS2_STATUS);
diff --git a/src/mouse.c b/src/mouse.c
index 22d0148..0f0a75f 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -335,10 +335,13 @@ void VISIBLE16
handle_74()
{
debug_isr(DEBUG_ISR_74);
+ if (! CONFIG_PS2_MOUSE)
+ goto done;
irq_enable();
int74_function();
irq_disable();
+done:
eoi_pic2();
}
diff --git a/src/post.c b/src/post.c
index 9e0d5ff..93d8210 100644
--- a/src/post.c
+++ b/src/post.c
@@ -170,6 +170,8 @@ init_bios_tables(void)
static void
init_boot_vectors()
{
+ if (! CONFIG_BOOT)
+ return;
dprintf(3, "init boot device ordering\n");
// Floppy drive
@@ -258,6 +260,9 @@ rom_scan(u32 start, u32 end)
// Found a device that thinks it can boot the system. Record
// its BEV and product name string.
+ if (! CONFIG_BOOT)
+ continue;
+
if (ebda->ipl.count >= ARRAY_SIZE(ebda->ipl.table))
continue;
diff --git a/src/post_menu.c b/src/post_menu.c
index 5115321..caba7da 100644
--- a/src/post_menu.c
+++ b/src/post_menu.c
@@ -42,6 +42,9 @@ udelay_and_check_for_keystroke(u32 usec, int count)
void
interactive_bootmenu()
{
+ if (! CONFIG_BOOTMENU)
+ return;
+
while (check_for_keystroke())
get_keystroke();
diff --git a/src/serial.c b/src/serial.c
index 46a9558..6d1f928 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -31,7 +31,10 @@ detect_serial(u16 port, u8 timeout, u8 count)
void
serial_setup()
{
+ if (! CONFIG_SERIAL)
+ return;
dprintf(3, "init serial\n");
+
u16 count = 0;
count += detect_serial(0x3f8, 0x0a, count);
count += detect_serial(0x2f8, 0x0a, count);
@@ -151,6 +154,10 @@ void VISIBLE16
handle_14(struct bregs *regs)
{
debug_enter(regs, DEBUG_HDL_14);
+ if (! CONFIG_SERIAL) {
+ handle_14XX(regs);
+ return;
+ }
irq_enable();
@@ -186,7 +193,10 @@ detect_parport(u16 port, u8 timeout, u8 count)
void
lpt_setup()
{
+ if (! CONFIG_LPT)
+ return;
dprintf(3, "init lpt\n");
+
u16 count = 0;
count += detect_parport(0x378, 0x14, count);
count += detect_parport(0x278, 0x14, count);
@@ -280,6 +290,10 @@ void VISIBLE16
handle_17(struct bregs *regs)
{
debug_enter(regs, DEBUG_HDL_17);
+ if (! CONFIG_LPT) {
+ handle_17XX(regs);
+ return;
+ }
irq_enable();
diff --git a/src/smm.c b/src/smm.c
index 9500e92..6f5fbb1 100644
--- a/src/smm.c
+++ b/src/smm.c
@@ -10,6 +10,7 @@
#include "config.h" // CONFIG_*
#include "ioport.h" // outb
+#if CONFIG_USE_SMM
asm(
".global smm_relocation_start\n"
".global smm_relocation_end\n"
@@ -67,6 +68,7 @@ asm(
"smm_code_end:\n"
" .code32\n"
);
+#endif
extern u8 smm_relocation_start, smm_relocation_end;
extern u8 smm_code_start, smm_code_end;