- removed special case for the Bochs VBE LFB base address (it can be treated

like other PCI devices now)
- changed base address for the PCI memory space to 0xc0000000
- rombios32: fixed a warning
- fixed timeout flag for serial i/o functions
This commit is contained in:
Volker Ruppert 2009-04-10 16:37:02 +00:00
parent 1020f9d9ea
commit 3b0fb9f28a
4 changed files with 23 additions and 27 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: rombios.c,v 1.229 2009-04-09 20:34:09 sshwarts Exp $
// $Id: rombios.c,v 1.230 2009-04-10 16:36:34 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -937,7 +937,7 @@ Bit16u cdrom_boot();
#endif // BX_ELTORITO_BOOT
static char bios_cvs_version_string[] = "$Revision: 1.229 $ $Date: 2009-04-09 20:34:09 $";
static char bios_cvs_version_string[] = "$Revision: 1.230 $ $Date: 2009-04-10 16:36:34 $";
#define BIOS_COPYRIGHT_STRING "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team."
@ -3738,21 +3738,20 @@ cdrom_boot()
// ---------------------------------------------------------------------------
#endif // BX_ELTORITO_BOOT
void
int14_function(regs, ds, iret_addr)
void int14_function(regs, ds, iret_addr)
pusha_regs_t regs; // regs pushed from PUSHA instruction
Bit16u ds; // previous DS:, DS set to 0x0000 by asm wrapper
iret_addr_t iret_addr; // CS,IP,Flags pushed from original INT call
{
Bit16u addr,timer,val16;
Bit8u timeout;
Bit8u counter;
ASM_START
sti
ASM_END
addr = read_word(0x0040, (regs.u.r16.dx << 1));
timeout = read_byte(0x0040, 0x007C + regs.u.r16.dx);
counter = read_byte(0x0040, 0x007C + regs.u.r16.dx);
if ((regs.u.r16.dx < 4) && (addr > 0)) {
switch (regs.u.r8.ah) {
case 0:
@ -3772,32 +3771,35 @@ int14_function(regs, ds, iret_addr)
break;
case 1:
timer = read_word(0x0040, 0x006C);
while (((inb(addr+5) & 0x60) != 0x60) && (timeout)) {
while (((inb(addr+5) & 0x60) != 0x60) && (counter)) {
val16 = read_word(0x0040, 0x006C);
if (val16 != timer) {
timer = val16;
timeout--;
counter--;
}
}
if (timeout) outb(addr, regs.u.r8.al);
regs.u.r8.ah = inb(addr+5);
if (!timeout) regs.u.r8.ah |= 0x80;
if (counter > 0) {
outb(addr, regs.u.r8.al);
regs.u.r8.ah = inb(addr+5);
} else {
regs.u.r8.ah = 0x80;
}
ClearCF(iret_addr.flags);
break;
case 2:
timer = read_word(0x0040, 0x006C);
while (((inb(addr+5) & 0x01) == 0) && (timeout)) {
while (((inb(addr+5) & 0x01) == 0) && (counter)) {
val16 = read_word(0x0040, 0x006C);
if (val16 != timer) {
timer = val16;
timeout--;
counter--;
}
}
if (timeout) {
regs.u.r8.ah = 0;
if (counter > 0) {
regs.u.r8.ah = inb(addr+5);
regs.u.r8.al = inb(addr);
} else {
regs.u.r8.ah = inb(addr+5);
regs.u.r8.ah = 0x80;
}
ClearCF(iret_addr.flags);
break;
@ -9787,7 +9789,7 @@ pcibios_init_sel_reg:
pcibios_init_iomem_bases:
push bp
mov bp, sp
mov eax, #0xe0000000 ;; base for memory init
mov eax, #0xc0000000 ;; base for memory init
push eax
mov ax, #0xc000 ;; base for i/o init
push ax

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: rombios32.c,v 1.46 2009-02-20 15:36:29 sshwarts Exp $
// $Id: rombios32.c,v 1.47 2009-04-10 16:36:34 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// 32 bit Bochs BIOS init code
@ -149,7 +149,7 @@ static inline uint8_t readb(const void *addr)
return *(volatile const uint8_t *)addr;
}
static inline void putc(int c)
static inline void putch(int c)
{
outb(INFO_PORT, c);
}
@ -396,7 +396,7 @@ void bios_printf(int flags, const char *fmt, ...)
vsnprintf(buf, sizeof(buf), fmt, ap);
s = buf;
while (*s)
putc(*s++);
putch(*s++);
va_end(ap);
}
@ -902,12 +902,6 @@ static void pci_bios_init_device(PCIDevice *d)
pci_set_io_region_addr(d, 3, 0x374);
}
break;
case 0x0300: /* Display controller - VGA compatible controller */
if (vendor_id != 0x1234)
goto default_map;
/* VGA: map frame buffer to default Bochs VBE address */
pci_set_io_region_addr(d, 0, 0xE0000000);
break;
case 0x0800: /* Generic system peripheral - PIC */
if (vendor_id == PCI_VENDOR_ID_IBM) {
/* IBM */
@ -993,7 +987,7 @@ void pci_for_each_device(void (*init_func)(PCIDevice *d))
void pci_bios_init(void)
{
pci_bios_io_addr = 0xc000;
pci_bios_mem_addr = 0xf0000000;
pci_bios_mem_addr = 0xc0000000;
pci_bios_bigmem_addr = ram_size;
if (pci_bios_bigmem_addr < 0x90000000)
pci_bios_bigmem_addr = 0x90000000;