diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-04-19 12:22:22 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-05-06 12:10:36 -0400 |
commit | 6c68e7adfa6255268a80522ea39dfef4aa20ca70 (patch) | |
tree | fe7f741029166626daf5d21930d1f499ac37dcda /src | |
parent | d85c22e44ee4e24f2be19d579ea8fa0066a85fbb (diff) | |
download | seabios-hppa-6c68e7adfa6255268a80522ea39dfef4aa20ca70.zip seabios-hppa-6c68e7adfa6255268a80522ea39dfef4aa20ca70.tar.gz seabios-hppa-6c68e7adfa6255268a80522ea39dfef4aa20ca70.tar.bz2 |
If an int 1587 call is made from an option rom, stay in bigreal mode.
Modify the int 1587 handler to check if the POST phase is still
running. If it is, use bigreal mode segment limits so that the caller
remains in bigreal mode when the 1587 handler completes. This helps
with SeaVGABIOS' use of "direct" framebuffer accesses (an option rom
may attempt to display text during its option rom execution which can
cause SeaVGABIOS to make the int 1587 calls).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/misc.c | 9 | ||||
-rw-r--r-- | src/post.c | 2 | ||||
-rw-r--r-- | src/resume.c | 3 | ||||
-rw-r--r-- | src/system.c | 9 | ||||
-rw-r--r-- | src/util.h | 1 |
5 files changed, 17 insertions, 7 deletions
@@ -14,6 +14,15 @@ #define PORT_MATH_CLEAR 0x00f0 +// Indicator if POST phase has been started (and if it has completed). +int HaveRunPost VARFSEG; + +int +in_post(void) +{ + return GET_GLOBAL(HaveRunPost) == 1; +} + /**************************************************************** * Misc 16bit ISRs @@ -185,6 +185,8 @@ prepareboot(void) malloc_prepboot(); memmap_prepboot(); + HaveRunPost = 2; + // Setup bios checksum. BiosChecksum -= checksum((u8*)BUILD_BIOS_ADDR, BUILD_BIOS_SIZE); } diff --git a/src/resume.c b/src/resume.c index e2ceef1..1903174 100644 --- a/src/resume.c +++ b/src/resume.c @@ -17,9 +17,6 @@ #include "string.h" // memset #include "util.h" // dma_setup -// Indicator if POST phase has been run. -int HaveRunPost VARFSEG; - // Handler for post calls that look like a resume. void VISIBLE16 handle_resume(void) diff --git a/src/system.c b/src/system.c index 5d10cc8..3cb2228 100644 --- a/src/system.c +++ b/src/system.c @@ -115,12 +115,13 @@ handle_1587(struct bregs *regs) SET_FARVAR(gdt_seg, gdt_far[1], GDT_DATA | GDT_LIMIT((6*sizeof(u64))-1) | GDT_BASE(loc)); // Initialize CS descriptor - SET_FARVAR(gdt_seg, gdt_far[4], GDT_CODE | GDT_LIMIT(BUILD_BIOS_SIZE-1) - | GDT_BASE(BUILD_BIOS_ADDR)); + u64 lim = GDT_LIMIT(0x0ffff); + if (in_post()) + lim = GDT_GRANLIMIT(0xffffffff); + SET_FARVAR(gdt_seg, gdt_far[4], GDT_CODE | lim | GDT_BASE(BUILD_BIOS_ADDR)); // Initialize SS descriptor loc = (u32)MAKE_FLATPTR(GET_SEG(SS), 0); - SET_FARVAR(gdt_seg, gdt_far[5], GDT_DATA | GDT_LIMIT(0x0ffff) - | GDT_BASE(loc)); + SET_FARVAR(gdt_seg, gdt_far[5], GDT_DATA | lim | GDT_BASE(loc)); u16 count = regs->cx; asm volatile( @@ -178,6 +178,7 @@ void process_key(u8 key); // misc.c extern struct bios_config_table_s BIOS_CONFIG_TABLE __aligned(1); extern u8 BiosChecksum; +int in_post(void); void mathcp_setup(void); // mouse.c |