vgabios support

This commit is contained in:
Ronald G. Minnich 2002-03-29 03:57:56 +00:00
commit 70fa314d22
2 changed files with 20 additions and 41 deletions

View file

@ -275,7 +275,19 @@ void hardwaremain(int boot_complete)
post_code(0x88);
pci_enable();
post_code(0x89);
// it's not clear where I should do this. We'll try here.
// Seems to be ok in practice.
#if CONFIG_REALMODE_IDT == 1
printk_debug("INSTALL REAL-MODE IDT\n");
setup_realmode_idt();
#endif
#if CONFIG_VGABIOS == 1
printk_debug("DO THE VGA BIOS\n");
do_vgabios();
post_code(0x90);
#endif
// generic mainboard fixup
mainboard_fixup();
@ -320,14 +332,6 @@ void hardwaremain(int boot_complete)
/* make certain we are the only cpu running in linuxBIOS */
wait_for_other_cpus();
#if CONFIG_REALMODE_IDT == 1
printk_debug("INSTALL REAL-MODE IDT\n");
setup_realmode_idt();
#endif
#if CONFIG_VGABIOS == 1
printk_debug("DO THE VGA BIOS\n");
do_vgabios();
#endif
/* Now that we have collected all of our information
* write our configuration tables.
*/

View file

@ -73,8 +73,12 @@ static void real_mode_switch_call_vga(void)
{
__asm__ __volatile__
(
/* Now that our memcpy is done we can get to 16 bit code
* segment. This configures CS properly for real mode. */
/* save the stack */
"mov %esp, __stack\n"
"jmp 1f\n"
"__stack: .long 0\n"
"1:\n"
/* This configures CS properly for real mode. */
" ljmp $0x28, $__rms_16bit\n"
"__rms_16bit: \n"
".code16 \n" /* 16 bit code from here on... */
@ -130,42 +134,13 @@ static void real_mode_switch_call_vga(void)
" mov %ax, %es \n"
" mov %ax, %fs \n"
" mov %ax, %gs \n"
"ret\n"
" mov %ax, %ss \n"
" mov __stack, %esp\n"
);
}
__asm__ (".text\n""real_mode_switch_end:\n");
extern char real_mode_switch_end[];
#if 0
//static
int monte_restart(unsigned long entry_addr, unsigned long flags) {
void * ptr;
struct page *pg;
/*----- POINT OF NO RETURN IS HERE --------------------------------------*/
/* Ok, now the real monkey business begins.... Please keep hands
* and feet inside the memory space and remain seated until the
* ride comes to a complete stop. */
__asm__ __volatile__
(/* Install the IDT and GDT we copied to page zero. */
"lidt %0 \n"
"lgdt %1 \n"
/* Function call with args... sort of */
"pushl %4 \n"
"pushl %3 \n"
"pushl %2 \n" /* Push args on the stack */
"sub $4, %%esp \n" /* bogo return address */
"ljmp $0x10, $0x1000-(real_mode_switch_end-real_mode_switch) \n" : :
"m" (real_mode_idt), "m" (real_mode_gdt),
"r" (m_pg_list), "r" (entry_addr), "r" (flags)
: "memory");
/* NOT REACHED */
while(1); /* Shut up gcc. */
}
#endif
void
do_vgabios(void)
{