From: Peter Dinda Date: Fri, 2 May 2008 23:58:43 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: working-cdboot-physical-but-not-qemu X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=624a05de781c51ed5d34a6db2583f884918a9594;hp=43c556d146e12c7f35612e3a8cf6420b42fdef70 *** empty log message *** --- diff --git a/palacios/src/geekos/int.c b/palacios/src/geekos/int.c index 84431cf..513240d 100644 --- a/palacios/src/geekos/int.c +++ b/palacios/src/geekos/int.c @@ -1,7 +1,7 @@ /* * GeekOS interrupt handling data structures and functions * Copyright (c) 2001,2003 David H. Hovemeyer - * $Revision: 1.5 $ + * $Revision: 1.6 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -317,7 +317,6 @@ char *exception_type_names[] = { static void Dummy_Interrupt_Handler(struct Interrupt_State* state) { Begin_IRQ(state); - /* A "feature" of some chipsets is that if an interrupt is raised by mistake * then its automatically assigned to IRQ 7(Int 39). diff --git a/palacios/src/geekos/irq.c b/palacios/src/geekos/irq.c index a98c3ad..c94aeeb 100644 --- a/palacios/src/geekos/irq.c +++ b/palacios/src/geekos/irq.c @@ -1,7 +1,7 @@ /* * This is the device-driver interface to the interrupt system. * Copyright (c) 2001,2003 David H. Hovemeyer - * $Revision: 1.2 $ + * $Revision: 1.3 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -12,6 +12,8 @@ #include #include +#include + /* ---------------------------------------------------------------------- * Private functions and data * ---------------------------------------------------------------------- */ @@ -110,6 +112,7 @@ void Disable_IRQ(int irq) */ void Begin_IRQ(struct Interrupt_State* state) { + } /* diff --git a/palacios/src/geekos/main.c b/palacios/src/geekos/main.c index fed6908..de46041 100644 --- a/palacios/src/geekos/main.c +++ b/palacios/src/geekos/main.c @@ -3,7 +3,7 @@ * Copyright (c) 2001,2003,2004 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth * Copyright (c) 2004, Iulian Neamtiu - * $Revision: 1.34 $ + * $Revision: 1.35 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -178,6 +178,9 @@ void Main(struct Boot_Info* bootInfo) ulong_t doIBuzz = 0; + Out_Byte(0x1234,5); + Out_Byte(0x1234,5); + Init_BSS(); Init_Screen(); @@ -216,10 +219,8 @@ void Main(struct Boot_Info* bootInfo) SerialPrint("Dumping kernel Code (first 512 bytes @ 0x%x)\n",KERNEL_START); SerialMemDump((unsigned char *)VM_KERNEL_START, 512); */ -#endif -#if 1 - SerialPrintLevel(1000,"Launching Noisemaker and keyboard listener threads\n"); + SerialPrint("Noisemaker and keyboard listener threads\n"); key_thread = Start_Kernel_Thread(Keyboard_Listener, (ulong_t)&doIBuzz, PRIORITY_NORMAL, false); spkr_thread = Start_Kernel_Thread(Buzzer, (ulong_t)&doIBuzz, PRIORITY_NORMAL, false); diff --git a/palacios/src/geekos/mem.c b/palacios/src/geekos/mem.c index c98065d..4f284f1 100644 --- a/palacios/src/geekos/mem.c +++ b/palacios/src/geekos/mem.c @@ -1,8 +1,8 @@ -/* + /* * Physical memory allocation * Copyright (c) 2001,2003,2004 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth - * $Revision: 1.6 $ + * $Revision: 1.7 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -240,7 +240,8 @@ void Init_BSS(void) /* Fill .bss with zeroes */ memset(&BSS_START, '\0', &BSS_END - &BSS_START); - // PrintBoth("BSS Inited, BSS_START=%x, BSS_END=%x\n",BSS_START,BSS_END); + // screen is not inited yet - PAD + // PrintBoth("BSS Inited, BSS_START=%x, BSS_END=%x\n",BSS_START,BSS_END); } /* diff --git a/palacios/src/geekos/serial.c b/palacios/src/geekos/serial.c index 4f79c84..f769d7f 100644 --- a/palacios/src/geekos/serial.c +++ b/palacios/src/geekos/serial.c @@ -10,7 +10,6 @@ unsigned short serial_io_addr = 0; uint_t serial_print_level; - static void Serial_Interrupt_Handler(struct Interrupt_State * state) { char rcv_byte; char irq_id; diff --git a/palacios/src/geekos/vm.c b/palacios/src/geekos/vm.c index 2dd250f..300ac56 100644 --- a/palacios/src/geekos/vm.c +++ b/palacios/src/geekos/vm.c @@ -303,18 +303,18 @@ int RunVMM(struct Boot_Info * bootInfo) { hook_io_port(&(vm_info.io_map), 0x403, &IO_Read, &IO_Write_to_Serial, NULL); { - //struct vm_device * nvram = create_nvram(); + struct vm_device * nvram = create_nvram(); //struct vm_device * timer = create_timer(); struct vm_device * pic = create_pic(); - //attach_device(&(vm_info), nvram); + attach_device(&(vm_info), nvram); //attach_device(&(vm_info), timer); attach_device(&(vm_info), pic); PrintDebugDevMgr(&(vm_info.dev_mgr)); } - // hook_irq(&vm_info, 6); + hook_irq(&vm_info, 6); hook_irq(&vm_info, 14); hook_irq(&vm_info, 15); diff --git a/palacios/src/geekos/vmm_stubs.c b/palacios/src/geekos/vmm_stubs.c index 6a436b8..28f1126 100644 --- a/palacios/src/geekos/vmm_stubs.c +++ b/palacios/src/geekos/vmm_stubs.c @@ -73,8 +73,10 @@ int hook_irq_stub(struct guest_info * info, int irq) { SerialPrint("Hooking IRQ: %d (vm=0x%x)\n", irq, info); irq_map[irq] = info; - Install_IRQ(irq, pic_intr_handler); - Enable_IRQ(irq); + volatile void *foo = pic_intr_handler; + foo=0; + // Install_IRQ(irq, pic_intr_handler); + // Enable_IRQ(irq); return 0; } diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 3d98ec6..ee7ff6d 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -147,8 +147,11 @@ int start_svm_guest(struct guest_info *info) { //launch_svm((vmcb_t*)(info->vmm_data)); //PrintDebug("SVM Returned\n"); - STGI(); + + STGI(); + + if (handle_svm_exit(info) != 0) { PrintDebug("SVM ERROR!!\n"); break; diff --git a/palacios/src/vmboot/rombios/Makefile b/palacios/src/vmboot/rombios/Makefile index 1d16fb2..c42eaaf 100644 --- a/palacios/src/vmboot/rombios/Makefile +++ b/palacios/src/vmboot/rombios/Makefile @@ -22,6 +22,16 @@ BIOS-bochs-latest: rombios.c biossums ./biossums BIOS-bochs-latest rm -f _rombios_.s +BIOS-bochs-latest.elf: rombios.c biossums + gcc -DBX_SMP_PROCESSORS=1 -E -P $< > _rombios_elf.c + bcc -o rombios_elf.s -C-c -D__i86__ -0 -S _rombios_elf.c + sed -e 's/^\.text//' -e 's/^\.data//' rombios_elf.s > _rombios_elf.s + as86 _rombios_elf.s -u- -w- -g -0 -j -O -l rombios_elf.txt + -perl makesym.perl < rombios_elf.txt > rombios_elf.sym + mv tmp.bin BIOS-bochs-latest.elf + ./biossums BIOS-bochs-latest.elf +# rm -f _rombios_.s + biossums: biossums.c gcc -o biossums biossums.c diff --git a/palacios/src/vmboot/rombios/rombios.c b/palacios/src/vmboot/rombios/rombios.c index 05796c8..9c0d1f3 100644 --- a/palacios/src/vmboot/rombios/rombios.c +++ b/palacios/src/vmboot/rombios/rombios.c @@ -1,6 +1,6 @@ // -*- fundamental -*- ///////////////////////////////////////////////////////////////////////// -// $Id: rombios.c,v 1.2 2008/04/11 19:12:59 jarusl Exp $ +// $Id: rombios.c,v 1.3 2008/05/02 23:58:51 pdinda Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -130,13 +130,13 @@ // // BCC Bug: find a generic way to handle the bug of #asm after an "if" (fixed in 0.16.7) -#define DEBUG_ROMBIOS 0 +#define DEBUG_ROMBIOS 1 -#define DEBUG_ATA 0 +#define DEBUG_ATA 1 #define DEBUG_INT13_HD 0 #define DEBUG_INT13_CD 0 #define DEBUG_INT13_ET 0 -#define DEBUG_INT13_FL 0 +#define DEBUG_INT13_FL 1 #define DEBUG_INT15 0 #define DEBUG_INT16 0 #define DEBUG_INT1A 0 @@ -945,10 +945,10 @@ Bit16u cdrom_boot(); #endif // BX_ELTORITO_BOOT -static char bios_cvs_version_string[] = "$Revision: 1.2 $"; -static char bios_date_string[] = "$Date: 2008/04/11 19:12:59 $"; +static char bios_cvs_version_string[] = "$Revision: 1.3 $"; +static char bios_date_string[] = "$Date: 2008/05/02 23:58:51 $"; -static char CVSID[] = "$Id: rombios.c,v 1.2 2008/04/11 19:12:59 jarusl Exp $"; +static char CVSID[] = "$Id: rombios.c,v 1.3 2008/05/02 23:58:51 pdinda Exp $"; /* Offset to skip the CVS $Id: prefix */ #define bios_version_string (CVSID + 4) @@ -958,7 +958,7 @@ static char CVSID[] = "$Id: rombios.c,v 1.2 2008/04/11 19:12:59 jarusl Exp $"; #define BIOS_PRINTF_INFO 4 #define BIOS_PRINTF_DEBUG 8 #define BIOS_PRINTF_ALL (BIOS_PRINTF_SCREEN | BIOS_PRINTF_INFO) -#define BIOS_PRINTF_DEBHALT (BIOS_PRINTF_SCREEN | BIOS_PRINTF_INFO | BIOS_PRINTF_HALT) +#define BIOS_PRINTF_DEBHALT (BIOS_PRINTF_SCREEN | BIOS_PRINTF_INFO | BIOS_PRINTF_HALT) #define printf(format, p...) bios_printf(BIOS_PRINTF_SCREEN, format, ##p) @@ -966,7 +966,7 @@ static char CVSID[] = "$Id: rombios.c,v 1.2 2008/04/11 19:12:59 jarusl Exp $"; // BX_DEBUG goes to INFO port until we can easily choose debug info on a // per-device basis. Debug info are sent only in debug mode #if DEBUG_ROMBIOS -# define BX_DEBUG(format, p...) bios_printf(BIOS_PRINTF_INFO, format, ##p) +# define BX_DEBUG(format, p...) bios_printf(BIOS_PRINTF_ALL, format, ##p) #else # define BX_DEBUG(format, p...) #endif @@ -1669,7 +1669,7 @@ keyboard_init() Bit16u max; int rc; - printf("rombios: keyboard_init\n"); + BX_DEBUG("rombios: keyboard_init\n"); /* printf("Assuming keyboard already inited and returning\n"); return; */ @@ -2128,7 +2128,7 @@ void ata_init( ) Bit16u ebda_seg=read_word(0x0040,0x000E); Bit8u channel, device; - printf("rom_bios: ata_init\n"); + //BX_DEBUG("rombios: ata_init\n"); // Channels info init. for (channel=0; channel 0 write_byte(ebda_seg,&EbdaData->ata.channels[0].iface,ATA_IFACE_ISA); write_word(ebda_seg,&EbdaData->ata.channels[0].iobase1,0x1f0); @@ -3189,7 +3191,7 @@ cdemu_init() { Bit16u ebda_seg=read_word(0x0040,0x000E); - printf("rombios: cdemu_init\n"); + //BX_DEBUG("rombios: cdemu_init\n"); // the only important data is this one for now write_byte(ebda_seg,&EbdaData->cdemu.active,0x00); @@ -3225,6 +3227,7 @@ cdrom_boot() Bit16u boot_segment, nbsectors, i, error; Bit8u device; + // Find out the first cdrom for (device=0; devicecdemu.media)) { case 0x01: // 1.2M floppy @@ -6682,6 +6689,9 @@ floppy_drive_exists(drive) { Bit8u drive_type; + // just tell it both drives exist - PAD + return 1; + // check CMOS to see if drive exists drive_type = inb_cmos(0x10); if (drive == 0) @@ -6706,6 +6716,8 @@ int13_diskette_function(DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS) Bit8u drive_type, num_floppies, ah; Bit16u es, last_addr; + printf("In int13_diskette\n"); + BX_DEBUG_INT13_FL("int13_diskette: AX=%04x BX=%04x CX=%04x DX=%04x ES=%04x\n", AX, BX, CX, DX, ES); // BX_DEBUG_INT13_FL("int13_diskette: SS=%04x DS=%04x ES=%04x DI=%04x SI=%04x\n",get_SS(), get_DS(), ES, DI, SI); @@ -7575,6 +7587,8 @@ Bit8u bseqnr; Bit16u bootseg; Bit16u status; Bit8u lastdrive=0; + + // BX_DEBUG("rombios: int19 (%d)\n",bseqnr); // if BX_ELTORITO_BOOT is not defined, old behavior // check bit 5 in CMOS reg 0x2d. load either 0x00 or 0x80 into DL @@ -7624,6 +7638,8 @@ Bit8u bseqnr; if (bootcd != 0) { status = cdrom_boot(); + + // If failure if ( (status & 0x00ff) !=0 ) { print_cdromboot_failure(status); @@ -7641,6 +7657,8 @@ Bit8u bseqnr; if (bootcd == 0) { bootseg=0x07c0; + + ASM_START push bp mov bp, sp @@ -7665,6 +7683,7 @@ int19_load_done: pop bp ASM_END + if (status != 0) { print_boot_failure(bootcd, bootdrv, 1, lastdrive); return 0x00000000; @@ -7692,6 +7711,7 @@ ASM_END #if BX_ELTORITO_BOOT // Print out the boot string + BX_DEBUG("cdrom_boot: %x\n",status); print_boot_device(bootcd, bootdrv); #else // BX_ELTORITO_BOOT print_boot_device(0, bootdrv);