On Mon, Feb 22, 2010 at 02:56:22AM +0000, Natalia Portillo wrote:
Ok, QEMU is absolutely unable to boot nextstep/openstep, while using SeaBIOS.
Changing to old Bochs BIOS, makes it work, however no video is output (until NeXT starts using VESA).
Hi Natalia,
Is nextstep/openstep something that can be freely downloaded?
It would help if you can extract some SeaBIOS debugging info. I've uploaded a SeaBIOS image with the debug level set to 8 and serial debugging enabled. It is at:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100228
Can you use this image with qemu, add "-serial file:mylog" to qemu's command line, and forward the resulting "mylog" file back?
Also, please include the full qemu command line that you used.
Thanks, -Kevin
No, sorry.
NeXTStep and OpenStep are the precursors of Mac OS X and are retail (abandoned but).
The source code of the bootloader evolved in the currently available at http://opensource.apple.com but who knows how much it changed.
However I can test it with any you want, and if you want to add me to instant messaging you could guide me in the debugging.
Regards
El 28/02/2010, a las 19:51, Kevin O'Connor escribió:
On Mon, Feb 22, 2010 at 02:56:22AM +0000, Natalia Portillo wrote:
Ok, QEMU is absolutely unable to boot nextstep/openstep, while using SeaBIOS.
Changing to old Bochs BIOS, makes it work, however no video is output (until NeXT starts using VESA).
Hi Natalia,
Is nextstep/openstep something that can be freely downloaded?
It would help if you can extract some SeaBIOS debugging info. I've uploaded a SeaBIOS image with the debug level set to 8 and serial debugging enabled. It is at:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100228
Can you use this image with qemu, add "-serial file:mylog" to qemu's command line, and forward the resulting "mylog" file back?
Also, please include the full qemu command line that you used.
Thanks, -Kevin
This is everything I got.
I don't see anything useful.
Command lines:
qemu -L . -serial file:nextstep33-floppy.log -fda 3.3_Boot_Disk.floppyimage -hda nextstep33.qcow2 -cdrom NeXTStep\ Release\ 3.3\ for\ Intel\ Processors\ and\ NeXT\ Computers.iso - monitor stdio
qemu -L . -serial file:nextstep33-hdd.log -hda hd.img -monitor stdio
qemu -L . -monitor stdio -serial file:nextstep32.log -fda 3.2_Boot_Disk.floppyimage
qemu -L . -monitor stdio -serial file:openstep40.log -fda 4.0_Install_Disk.floppyimage
qemu -L . -monitor stdio -serial file:openstep42.log -fda 4.2_Install_Disk.floppyimage
qemu -L . -monitor stdio -serial file:rhapsody-dr1.log -fda Rhapboot.img
qemu -L . -monitor stdio -serial file:rhapsody-dr2.log -fda InstallationDisk.image
qemu -L . -monitor stdio -serial file:darwin131.log -cdrom Apple\ Darwin\ 1.3.1\ (x86).iso
qemu -L . -monitor stdio -serial file:darwin141.log -cdrom Apple\ Darwin\ 1.4.1\ (x86).iso
qemu -L . -monitor stdio -serial file:darwin602.log -cdrom Apple\ Darwin\ 6.0.2\ (x86).iso
qemu -L . -monitor stdio -serial file:darwin701.log -cdrom Apple\ Darwin\ 7.0.1\ (PowerPC\ and\ x86).iso
qemu -L . -monitor stdio -serial file:darwin801.log -cdrom Apple\ Darwin\ 8.0.1\ (x86).iso
nextstep33 bootloader is NeXTStep boot 3.3.3.8, corresponding to NextStep 3.3. nextstep32 bootloader is NeXTStep boot 1.28, corresponding to NextStep 3.2. openstep40 bootloader is OPENSTEP boot 40.11, corresponding to OPENSTEP for Mach 4.0. openstep42 bootloader is OPENSTEP boot 40.13.1, corresponding to OPENSTEP for Mach 4.2. rhapsody-dr1 bootloader is Rhapsody boot 5.0.24, corresponding to Apple Rhapsody Developer Release. rhapsody-dr2 bootloader is Rhapsody boot 5.0.40, corresponding to Apple Rhapsody Developer Release 2. darwin131 bootloader is Darwin Intel boot 5.0.80.1, corresponding to Apple Darwin 1.3.1 (Mac OS X 10.0). darwin141 bootloader is Darwin/x86 boot 5.0.83.2, corresponding to Apple Darwin 1.4.1 (Mac OS X 10.1). darwin602 bootloader is Darwin/x86 boot 5.0.94, corresponding to Apple Darwin 6.0.2 (Mac OS X 10.2). darwin701 bootloader is Darwin/x86 boot 5.0.111, corresponding to Apple Darwin 7.0.2 (Mac OS X 10.3.1). darwin801 bootloader is Darwin/x86 boot 5.0.122, corresponding to Apple Darwin 8.0.1 (Mac OS X 10.4.1).
Darwin 6.0.2 bootloader IS WORKING, countdowns, receive keypresses, loads xnu, then xnu hangs. Darwin 7.0.1 bootloader IS WORKING, countdowns, receive keypresses, loads xnu, xnu starts loading modules, xnu panics (unable to mount root device). Darwin 8.0.1 bootloader IS WORKING, countdowns, receive keypresses, loads xnu, xnu starts loading modules, xnu mounts root, xnu starts installation, works flawlessly.
NextStep floppy images can be downloaded from http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/Mul... OpenStep floppy images can be downloaded from http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/Mul... Rhapsody floppy images are under NDA. Darwin CD images and bootloader source code can be downloaded from http://www.opensource.apple.com/
Luckily as Darwin is showing the same fail, and then, starts working, the source is available for checking.
Regards
On Thu, Mar 11, 2010 at 09:44:42AM +0000, Natalia Portillo wrote:
This is everything I got.
Thanks Natalia!
NextStep floppy images can be downloaded from http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/Mul... OpenStep floppy images can be downloaded from http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/Mul...
These floppy images are failing because they spin waiting for a keypress with irqs disabled, and SeaBIOS doesn't enable irqs in the handlers being called (same issue seen on "d090723b.zip" image reported by Roy).
I've put a test image with a workaround for the issue at:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100311
See below for the patch I used - I'm still researching it, but the image can be used for testing.
Rhapsody floppy images are under NDA. Darwin CD images and bootloader source code can be downloaded from http://www.opensource.apple.com/
I was unable to locate CD images that I could download from that site. I'm also not familiar with Darwin, and I do not know which package to download for bootloader source.
Thanks again, -Kevin
diff --git a/src/clock.c b/src/clock.c index 5a30e35..9afa71d 100644 --- a/src/clock.c +++ b/src/clock.c @@ -226,6 +226,7 @@ timer_setup(void) static void handle_1a00(struct bregs *regs) { + yield(); u32 ticks = GET_BDA(timer_counter); regs->cx = ticks >> 16; regs->dx = ticks; diff --git a/src/config.h b/src/config.h index 5316f22..226919b 100644 --- a/src/config.h +++ b/src/config.h @@ -16,9 +16,9 @@ #define CONFIG_COREBOOT 0
// Control how verbose debug output is. -#define CONFIG_DEBUG_LEVEL 1 +#define CONFIG_DEBUG_LEVEL 8 // Send debugging information to serial port -#define CONFIG_DEBUG_SERIAL 0 +#define CONFIG_DEBUG_SERIAL 1 // Screen writes are also sent to debug ports. #define CONFIG_SCREEN_AND_DEBUG 1
diff --git a/src/kbd.c b/src/kbd.c index 44dce57..72f4c02 100644 --- a/src/kbd.c +++ b/src/kbd.c @@ -51,6 +51,7 @@ enqueue_key(u8 scan_code, u8 ascii_code) static void dequeue_key(struct bregs *regs, int incr, int extended) { + yield(); u16 buffer_head; u16 buffer_tail; for (;;) { @@ -530,9 +531,19 @@ process_key(u8 key) // allow for keyboard intercept u32 eax = (0x4f << 8) | key; u32 flags; +#if 0 call16_simpint(0x15, &eax, &flags); if (!(flags & F_CF)) return; +#else + struct bregs br; + memset(&br, 0, sizeof(br)); + br.eax = eax; + call16_int(0x15, &br); + flags = br.flags; + if (!(flags & F_CF)) + return; +#endif key = eax; } __process_key(key);
Hi,
These floppy images are failing because they spin waiting for a keypress with irqs disabled, and SeaBIOS doesn't enable irqs in the handlers being called (same issue seen on "d090723b.zip" image reported by Roy).
I've put a test image with a workaround for the issue at:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100311
See below for the patch I used - I'm still researching it, but the image can be used for testing.
I tested only with NeXTStep 3.3 booting from hard disk and it worked.
I'll test the rest today but considering the PS/2 mouse emulation is not working (there is a bug in it that prevents NeXTStep PS/2 mouse driver and old X11 PS/2 mouse drivers working).
But for now, it boots up to the GUI flawlessly.
2010/3/12 Natalia Portillo claunia@claunia.com:
Hi,
These floppy images are failing because they spin waiting for a keypress with irqs disabled, and SeaBIOS doesn't enable irqs in the handlers being called (same issue seen on "d090723b.zip" image reported by Roy).
I've put a test image with a workaround for the issue at:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100311
See below for the patch I used - I'm still researching it, but the image can be used for testing.
I tested only with NeXTStep 3.3 booting from hard disk and it worked.
I'll test the rest today but considering the PS/2 mouse emulation is not working (there is a bug in it that prevents NeXTStep PS/2 mouse driver and old X11 PS/2 mouse drivers working).
mouse problem affects Hydrogen OS too. http://tommy.planet.free.fr/doku.php?id=hydrogen_os
Ok so in resume we have the following PS/2 mouse bugs:
NeXTStep and OpenStep PS/2 driver receives no movement at all from the mouse (Darwin PS/2 driver seems to be made from scratch so no helpful here). MS-DOS Mouse driver hangs the whole machine. Windows Me Setup mouse driver receives no movement at all from the mouse. Old XFree86 PS/2 mouse driver receives no movement at all from standard protocols (PS/2, IMPS/2) or random movements (Microsoft). Hydrogen OS mouse driver does not work.
While the NeXTStep PS/2 bug is known from QEMU 0.7.0 (which used Bochs BIOS), the other ones are new (as far as I know) so they may be or may not be caused by SeaBIOS.
2010/3/13 Natalia Portillo claunia@claunia.com:
Ok so in resume we have the following PS/2 mouse bugs:
NeXTStep and OpenStep PS/2 driver receives no movement at all from the mouse (Darwin PS/2 driver seems to be made from scratch so no helpful here). MS-DOS Mouse driver hangs the whole machine. Windows Me Setup mouse driver receives no movement at all from the mouse. Old XFree86 PS/2 mouse driver receives no movement at all from standard protocols (PS/2, IMPS/2) or random movements (Microsoft). Hydrogen OS mouse driver does not work.
While the NeXTStep PS/2 bug is known from QEMU 0.7.0 (which used Bochs BIOS), the other ones are new (as far as I know) so they may be or may not be caused by SeaBIOS.
for Hydrogen OS, when I use QEMU BIOS (yes with my -old-bios hack) it works in git head.
On Sat, Mar 13, 2010 at 10:44:46PM +0800, Roy Tam wrote:
2010/3/13 Natalia Portillo claunia@claunia.com:
Ok so in resume we have the following PS/2 mouse bugs:
NeXTStep and OpenStep PS/2 driver receives no movement at all from the mouse (Darwin PS/2 driver seems to be made from scratch so no helpful here). MS-DOS Mouse driver hangs the whole machine. Windows Me Setup mouse driver receives no movement at all from the mouse. Old XFree86 PS/2 mouse driver receives no movement at all from standard protocols (PS/2, IMPS/2) or random movements (Microsoft). Hydrogen OS mouse driver does not work.
While the NeXTStep PS/2 bug is known from QEMU 0.7.0 (which used Bochs BIOS), the other ones are new (as far as I know) so they may be or may not be caused by SeaBIOS.
for Hydrogen OS, when I use QEMU BIOS (yes with my -old-bios hack) it works in git head.
Can you test with:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100313
Change summary in this test image: * int 1601 / int 1a00 should enable irqs - fixes several boot hangs * Backup/restore registers on mouse/keyboard callbacks - fixes d090723b.zip * The mouse getid command may only return 1 byte - fixes msdos mouse hang * Always process key event in irq 09 handler - restores keyboard in ghost and fdos0138.img
This image is based off stable-0.5.1 (image debug-20100311 was mistakenly based off of git head which had an additional regression of enabling mouse irqs by default).
Interestingly, a ghost 11.5 image I found now works with mouse where it used to fail with bochs bios.
The code changes I've used are below. These changes are for testing - I'm still looking into a full fix.
-Kevin
diff --git a/src/clock.c b/src/clock.c index e32bf1b..241119e 100644 --- a/src/clock.c +++ b/src/clock.c @@ -228,6 +228,7 @@ timer_setup(void) static void handle_1a00(struct bregs *regs) { + yield(); u32 ticks = GET_BDA(timer_counter); regs->cx = ticks >> 16; regs->dx = ticks; diff --git a/src/config.h b/src/config.h index 6297a48..9a3a165 100644 --- a/src/config.h +++ b/src/config.h @@ -16,9 +16,9 @@ #define CONFIG_COREBOOT 0
// Control how verbose debug output is. -#define CONFIG_DEBUG_LEVEL 1 +#define CONFIG_DEBUG_LEVEL 8 // Send debugging information to serial port -#define CONFIG_DEBUG_SERIAL 0 +#define CONFIG_DEBUG_SERIAL 1 // Screen writes are also sent to debug ports. #define CONFIG_SCREEN_AND_DEBUG 1
diff --git a/src/kbd.c b/src/kbd.c index 6f3ae15..7e3434a 100644 --- a/src/kbd.c +++ b/src/kbd.c @@ -73,6 +73,7 @@ enqueue_key(u8 scan_code, u8 ascii_code) static void dequeue_key(struct bregs *regs, int incr, int extended) { + yield(); u16 buffer_head; u16 buffer_tail; for (;;) { @@ -552,9 +553,19 @@ process_key(u8 key) // allow for keyboard intercept u32 eax = (0x4f << 8) | key; u32 flags; +#if 0 call16_simpint(0x15, &eax, &flags); if (!(flags & F_CF)) return; +#else + struct bregs br; + memset(&br, 0, sizeof(br)); + br.eax = eax; + call16_int(0x15, &br); + flags = br.flags; + if (!(flags & F_CF)) + return; +#endif key = eax; } __process_key(key); diff --git a/src/mouse.c b/src/mouse.c index 52e225c..92fb16a 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -305,15 +305,17 @@ process_mouse(u8 data) return; }
- //BX_DEBUG_INT74("int74_function: make_farcall=1\n"); u16 status = GET_EBDA2(ebda_seg, mouse_data[0]); u16 X = GET_EBDA2(ebda_seg, mouse_data[1]); u16 Y = GET_EBDA2(ebda_seg, mouse_data[2]); SET_EBDA2(ebda_seg, mouse_flag1, 0);
struct segoff_s func = GET_EBDA2(ebda_seg, far_call_pointer); + dprintf(16, "mouse farcall s=%04x x=%04x y=%04x func=%04x:%04x\n" + , status, X, Y, func.seg, func.offset);
asm volatile( + "pusha\n" "sti\n"
"pushl %0\n" @@ -326,6 +328,7 @@ process_mouse(u8 data)
"cli\n" "cld\n" + "popa\n" : : "r"(func.segoff), "r"(status), "r"(X), "r"(Y) : "cc" diff --git a/src/ps2port.c b/src/ps2port.c index fb9d24a..759ad37 100644 --- a/src/ps2port.c +++ b/src/ps2port.c @@ -226,8 +226,11 @@ ps2_command(int aux, int command, u8 *param) if (ret) return ret;
+ // Flush any interrupts already pending. + yield(); + if (command == ATKBD_CMD_RESET_BAT) { - // Reset is special wrt timeouts. + // Reset is special wrt timeouts and bytes received.
// Send command. ret = ps2_sendbyte(aux, command, 1000); @@ -244,6 +247,29 @@ ps2_command(int aux, int command, u8 *param) // Some devices only respond with one byte on reset. ret = 0; param[1] = ret; + } else if (command == ATKBD_CMD_GETID) { + // Getid is special wrt bytes received. + + // Send command. + ret = ps2_sendbyte(aux, command, 200); + if (ret) + goto fail; + + // Receive parameters. + ret = ps2_recvbyte(aux, 0, 500); + if (ret < 0) + goto fail; + param[0] = ret; + if (ret == 0xab || ret == 0xac || ret == 0x2b || ret == 0x5d + || ret == 0x60 || ret == 0x47) { + // These ids (keyboards) return two bytes. + ret = ps2_recvbyte(aux, 0, 500); + if (ret < 0) + goto fail; + param[1] = ret; + } else { + param[1] = 0; + } } else { // Send command. ret = ps2_sendbyte(aux, command, 200); @@ -336,7 +362,8 @@ handle_09(void) return;
debug_isr(DEBUG_ISR_09); - process_ps2irq(); +// process_ps2irq(); + process_ps2byte(inb(PORT_PS2_STATUS), inb(PORT_PS2_DATA)); eoi_pic1(); }
2010/3/14 Kevin O'Connor kevin@koconnor.net:
On Sat, Mar 13, 2010 at 10:44:46PM +0800, Roy Tam wrote:
2010/3/13 Natalia Portillo claunia@claunia.com:
Ok so in resume we have the following PS/2 mouse bugs:
NeXTStep and OpenStep PS/2 driver receives no movement at all from the mouse (Darwin PS/2 driver seems to be made from scratch so no helpful here). MS-DOS Mouse driver hangs the whole machine. Windows Me Setup mouse driver receives no movement at all from the mouse. Old XFree86 PS/2 mouse driver receives no movement at all from standard protocols (PS/2, IMPS/2) or random movements (Microsoft). Hydrogen OS mouse driver does not work.
While the NeXTStep PS/2 bug is known from QEMU 0.7.0 (which used Bochs BIOS), the other ones are new (as far as I know) so they may be or may not be caused by SeaBIOS.
for Hydrogen OS, when I use QEMU BIOS (yes with my -old-bios hack) it works in git head.
Can you test with:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100313
Change summary in this test image:
- int 1601 / int 1a00 should enable irqs - fixes several boot hangs
- Backup/restore registers on mouse/keyboard callbacks - fixes
d090723b.zip
- The mouse getid command may only return 1 byte - fixes msdos mouse
hang
- Always process key event in irq 09 handler - restores keyboard in
ghost and fdos0138.img
This image is based off stable-0.5.1 (image debug-20100311 was mistakenly based off of git head which had an additional regression of enabling mouse irqs by default).
Interestingly, a ghost 11.5 image I found now works with mouse where it used to fail with bochs bios.
The code changes I've used are below. These changes are for testing - I'm still looking into a full fix.
Tested. Results belows: + NeXTStep/OpenStep bootloader no longer stalls. + EDR-DOS 7.01.08 WIP boots. + Paragon PTS-DOS 6.51CD/2000 Pro, GHOST, GW-BASIC, FreeDOS/V, MS-DOS 6.22 (Korean Edition), ET3 Chinese System, KC Chinese System, CCDOS97 Chinese System, etc. keyboard works. + CuteMouse driver no longer waits, MS Mouse Driver no longer freezes. + Hydrogen OS Mouse works. - OpenStep 4.2 installs but mouse only works for 1 second.
Natalia Portillo: Do you have a working config switches for NeXTStep 3.3? As it don't have (E)IDE/ATATPI driver in driver disks.
-Kevin
diff --git a/src/clock.c b/src/clock.c index e32bf1b..241119e 100644 --- a/src/clock.c +++ b/src/clock.c @@ -228,6 +228,7 @@ timer_setup(void) static void handle_1a00(struct bregs *regs) {
- yield(); u32 ticks = GET_BDA(timer_counter); regs->cx = ticks >> 16; regs->dx = ticks;
diff --git a/src/config.h b/src/config.h index 6297a48..9a3a165 100644 --- a/src/config.h +++ b/src/config.h @@ -16,9 +16,9 @@ #define CONFIG_COREBOOT 0
// Control how verbose debug output is. -#define CONFIG_DEBUG_LEVEL 1 +#define CONFIG_DEBUG_LEVEL 8 // Send debugging information to serial port -#define CONFIG_DEBUG_SERIAL 0 +#define CONFIG_DEBUG_SERIAL 1 // Screen writes are also sent to debug ports. #define CONFIG_SCREEN_AND_DEBUG 1
diff --git a/src/kbd.c b/src/kbd.c index 6f3ae15..7e3434a 100644 --- a/src/kbd.c +++ b/src/kbd.c @@ -73,6 +73,7 @@ enqueue_key(u8 scan_code, u8 ascii_code) static void dequeue_key(struct bregs *regs, int incr, int extended) {
- yield(); u16 buffer_head; u16 buffer_tail; for (;;) {
@@ -552,9 +553,19 @@ process_key(u8 key) // allow for keyboard intercept u32 eax = (0x4f << 8) | key; u32 flags; +#if 0 call16_simpint(0x15, &eax, &flags); if (!(flags & F_CF)) return; +#else
struct bregs br;
memset(&br, 0, sizeof(br));
br.eax = eax;
call16_int(0x15, &br);
flags = br.flags;
if (!(flags & F_CF))
return;
+#endif key = eax; } __process_key(key); diff --git a/src/mouse.c b/src/mouse.c index 52e225c..92fb16a 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -305,15 +305,17 @@ process_mouse(u8 data) return; }
//BX_DEBUG_INT74("int74_function: make_farcall=1\n"); u16 status = GET_EBDA2(ebda_seg, mouse_data[0]); u16 X = GET_EBDA2(ebda_seg, mouse_data[1]); u16 Y = GET_EBDA2(ebda_seg, mouse_data[2]); SET_EBDA2(ebda_seg, mouse_flag1, 0);
struct segoff_s func = GET_EBDA2(ebda_seg, far_call_pointer);
dprintf(16, "mouse farcall s=%04x x=%04x y=%04x func=%04x:%04x\n"
, status, X, Y, func.seg, func.offset);
asm volatile(
"pusha\n" "sti\n" "pushl %0\n"
@@ -326,6 +328,7 @@ process_mouse(u8 data)
"cli\n" "cld\n"
"popa\n" : : "r"(func.segoff), "r"(status), "r"(X), "r"(Y) : "cc"
diff --git a/src/ps2port.c b/src/ps2port.c index fb9d24a..759ad37 100644 --- a/src/ps2port.c +++ b/src/ps2port.c @@ -226,8 +226,11 @@ ps2_command(int aux, int command, u8 *param) if (ret) return ret;
- // Flush any interrupts already pending.
- yield();
- if (command == ATKBD_CMD_RESET_BAT) {
// Reset is special wrt timeouts.
// Reset is special wrt timeouts and bytes received. // Send command. ret = ps2_sendbyte(aux, command, 1000);
@@ -244,6 +247,29 @@ ps2_command(int aux, int command, u8 *param) // Some devices only respond with one byte on reset. ret = 0; param[1] = ret;
- } else if (command == ATKBD_CMD_GETID) {
// Getid is special wrt bytes received.
// Send command.
ret = ps2_sendbyte(aux, command, 200);
if (ret)
goto fail;
// Receive parameters.
ret = ps2_recvbyte(aux, 0, 500);
if (ret < 0)
goto fail;
param[0] = ret;
if (ret == 0xab || ret == 0xac || ret == 0x2b || ret == 0x5d
|| ret == 0x60 || ret == 0x47) {
// These ids (keyboards) return two bytes.
ret = ps2_recvbyte(aux, 0, 500);
if (ret < 0)
goto fail;
param[1] = ret;
} else {
param[1] = 0;
} else { // Send command. ret = ps2_sendbyte(aux, command, 200);}
@@ -336,7 +362,8 @@ handle_09(void) return;
debug_isr(DEBUG_ISR_09);
- process_ps2irq();
+// process_ps2irq();
- process_ps2byte(inb(PORT_PS2_STATUS), inb(PORT_PS2_DATA)); eoi_pic1();
}
2010/3/14 Roy Tam roytam@gmail.com:
2010/3/14 Kevin O'Connor kevin@koconnor.net:
On Sat, Mar 13, 2010 at 10:44:46PM +0800, Roy Tam wrote:
2010/3/13 Natalia Portillo claunia@claunia.com:
Ok so in resume we have the following PS/2 mouse bugs:
NeXTStep and OpenStep PS/2 driver receives no movement at all from the mouse (Darwin PS/2 driver seems to be made from scratch so no helpful here). MS-DOS Mouse driver hangs the whole machine. Windows Me Setup mouse driver receives no movement at all from the mouse. Old XFree86 PS/2 mouse driver receives no movement at all from standard protocols (PS/2, IMPS/2) or random movements (Microsoft). Hydrogen OS mouse driver does not work.
While the NeXTStep PS/2 bug is known from QEMU 0.7.0 (which used Bochs BIOS), the other ones are new (as far as I know) so they may be or may not be caused by SeaBIOS.
for Hydrogen OS, when I use QEMU BIOS (yes with my -old-bios hack) it works in git head.
Can you test with:
http://linuxtogo.org/~kevin/SeaBIOS/test/bios.bin-0.5.1-debug-20100313
Change summary in this test image:
- int 1601 / int 1a00 should enable irqs - fixes several boot hangs
- Backup/restore registers on mouse/keyboard callbacks - fixes
d090723b.zip
- The mouse getid command may only return 1 byte - fixes msdos mouse
hang
- Always process key event in irq 09 handler - restores keyboard in
ghost and fdos0138.img
This image is based off stable-0.5.1 (image debug-20100311 was mistakenly based off of git head which had an additional regression of enabling mouse irqs by default).
Interestingly, a ghost 11.5 image I found now works with mouse where it used to fail with bochs bios.
The code changes I've used are below. These changes are for testing - I'm still looking into a full fix.
Tested. Results belows:
- NeXTStep/OpenStep bootloader no longer stalls.
- EDR-DOS 7.01.08 WIP boots.
- Paragon PTS-DOS 6.51CD/2000 Pro, GHOST, GW-BASIC, FreeDOS/V, MS-DOS
6.22 (Korean Edition), ET3 Chinese System, KC Chinese System, CCDOS97 Chinese System, etc. keyboard works.
- CuteMouse driver no longer waits, MS Mouse Driver no longer freezes.
- Hydrogen OS Mouse works.
- OpenStep 4.2 installs but mouse only works for 1 second.
forget to mention: - DOS 1.1x - 1.25 still freeze after pressing [Enter] in date/time prompt or in shell prompt.
Natalia Portillo: Do you have a working config switches for NeXTStep 3.3? As it don't have (E)IDE/ATATPI driver in driver disks.
-Kevin
diff --git a/src/clock.c b/src/clock.c index e32bf1b..241119e 100644 --- a/src/clock.c +++ b/src/clock.c @@ -228,6 +228,7 @@ timer_setup(void) static void handle_1a00(struct bregs *regs) {
- yield(); u32 ticks = GET_BDA(timer_counter); regs->cx = ticks >> 16; regs->dx = ticks;
diff --git a/src/config.h b/src/config.h index 6297a48..9a3a165 100644 --- a/src/config.h +++ b/src/config.h @@ -16,9 +16,9 @@ #define CONFIG_COREBOOT 0
// Control how verbose debug output is. -#define CONFIG_DEBUG_LEVEL 1 +#define CONFIG_DEBUG_LEVEL 8 // Send debugging information to serial port -#define CONFIG_DEBUG_SERIAL 0 +#define CONFIG_DEBUG_SERIAL 1 // Screen writes are also sent to debug ports. #define CONFIG_SCREEN_AND_DEBUG 1
diff --git a/src/kbd.c b/src/kbd.c index 6f3ae15..7e3434a 100644 --- a/src/kbd.c +++ b/src/kbd.c @@ -73,6 +73,7 @@ enqueue_key(u8 scan_code, u8 ascii_code) static void dequeue_key(struct bregs *regs, int incr, int extended) {
- yield(); u16 buffer_head; u16 buffer_tail; for (;;) {
@@ -552,9 +553,19 @@ process_key(u8 key) // allow for keyboard intercept u32 eax = (0x4f << 8) | key; u32 flags; +#if 0 call16_simpint(0x15, &eax, &flags); if (!(flags & F_CF)) return; +#else
struct bregs br;
memset(&br, 0, sizeof(br));
br.eax = eax;
call16_int(0x15, &br);
flags = br.flags;
if (!(flags & F_CF))
return;
+#endif key = eax; } __process_key(key); diff --git a/src/mouse.c b/src/mouse.c index 52e225c..92fb16a 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -305,15 +305,17 @@ process_mouse(u8 data) return; }
//BX_DEBUG_INT74("int74_function: make_farcall=1\n"); u16 status = GET_EBDA2(ebda_seg, mouse_data[0]); u16 X = GET_EBDA2(ebda_seg, mouse_data[1]); u16 Y = GET_EBDA2(ebda_seg, mouse_data[2]); SET_EBDA2(ebda_seg, mouse_flag1, 0);
struct segoff_s func = GET_EBDA2(ebda_seg, far_call_pointer);
dprintf(16, "mouse farcall s=%04x x=%04x y=%04x func=%04x:%04x\n"
, status, X, Y, func.seg, func.offset);
asm volatile(
"pusha\n" "sti\n" "pushl %0\n"
@@ -326,6 +328,7 @@ process_mouse(u8 data)
"cli\n" "cld\n"
"popa\n" : : "r"(func.segoff), "r"(status), "r"(X), "r"(Y) : "cc"
diff --git a/src/ps2port.c b/src/ps2port.c index fb9d24a..759ad37 100644 --- a/src/ps2port.c +++ b/src/ps2port.c @@ -226,8 +226,11 @@ ps2_command(int aux, int command, u8 *param) if (ret) return ret;
- // Flush any interrupts already pending.
- yield();
- if (command == ATKBD_CMD_RESET_BAT) {
// Reset is special wrt timeouts.
// Reset is special wrt timeouts and bytes received. // Send command. ret = ps2_sendbyte(aux, command, 1000);
@@ -244,6 +247,29 @@ ps2_command(int aux, int command, u8 *param) // Some devices only respond with one byte on reset. ret = 0; param[1] = ret;
- } else if (command == ATKBD_CMD_GETID) {
// Getid is special wrt bytes received.
// Send command.
ret = ps2_sendbyte(aux, command, 200);
if (ret)
goto fail;
// Receive parameters.
ret = ps2_recvbyte(aux, 0, 500);
if (ret < 0)
goto fail;
param[0] = ret;
if (ret == 0xab || ret == 0xac || ret == 0x2b || ret == 0x5d
|| ret == 0x60 || ret == 0x47) {
// These ids (keyboards) return two bytes.
ret = ps2_recvbyte(aux, 0, 500);
if (ret < 0)
goto fail;
param[1] = ret;
} else {
param[1] = 0;
} else { // Send command. ret = ps2_sendbyte(aux, command, 200);}
@@ -336,7 +362,8 @@ handle_09(void) return;
debug_isr(DEBUG_ISR_09);
- process_ps2irq();
+// process_ps2irq();
- process_ps2byte(inb(PORT_PS2_STATUS), inb(PORT_PS2_DATA)); eoi_pic1();
}
On Sun, Mar 14, 2010 at 11:11:30AM +0800, Roy Tam wrote:
2010/3/14 Roy Tam roytam@gmail.com:
Tested. Results belows:
- NeXTStep/OpenStep bootloader no longer stalls.
- EDR-DOS 7.01.08 WIP boots.
- Paragon PTS-DOS 6.51CD/2000 Pro, GHOST, GW-BASIC, FreeDOS/V, MS-DOS
6.22 (Korean Edition), ET3 Chinese System, KC Chinese System, CCDOS97 Chinese System, etc. keyboard works.
- CuteMouse driver no longer waits, MS Mouse Driver no longer freezes.
- Hydrogen OS Mouse works.
Thanks!
- OpenStep 4.2 installs but mouse only works for 1 second.
Are the OpenStep CDs available somewhere?
forget to mention:
- DOS 1.1x - 1.25 still freeze after pressing [Enter] in date/time
prompt or in shell prompt.
Is that a regression from Bochs BIOS? Can you point me to an image I can try?
BTW, I've pushed a cleaned up set of fixes to latest SeaBIOS git.
-Kevin
2010/3/14 Kevin O'Connor kevin@koconnor.net:
On Sun, Mar 14, 2010 at 11:11:30AM +0800, Roy Tam wrote:
2010/3/14 Roy Tam roytam@gmail.com:
Tested. Results belows:
- NeXTStep/OpenStep bootloader no longer stalls.
- EDR-DOS 7.01.08 WIP boots.
- Paragon PTS-DOS 6.51CD/2000 Pro, GHOST, GW-BASIC, FreeDOS/V, MS-DOS
6.22 (Korean Edition), ET3 Chinese System, KC Chinese System, CCDOS97 Chinese System, etc. keyboard works.
- CuteMouse driver no longer waits, MS Mouse Driver no longer freezes.
- Hydrogen OS Mouse works.
Thanks!
- OpenStep 4.2 installs but mouse only works for 1 second.
Are the OpenStep CDs available somewhere?
forget to mention:
- DOS 1.1x - 1.25 still freeze after pressing [Enter] in date/time
prompt or in shell prompt.
Is that a regression from Bochs BIOS? Can you point me to an image I can try?
Yes this is a regression. with Bochs BIOS DOS 1.1x - 1.25 works fine.
BTW, I've pushed a cleaned up set of fixes to latest SeaBIOS git.
-Kevin
On Sun, Mar 14, 2010 at 01:28:01PM +0800, Roy Tam wrote:
2010/3/14 Kevin O'Connor kevin@koconnor.net:
On Sun, Mar 14, 2010 at 11:11:30AM +0800, Roy Tam wrote:
- DOS 1.1x - 1.25 still freeze after pressing [Enter] in date/time
prompt or in shell prompt.
Is that a regression from Bochs BIOS? Can you point me to an image I can try?
Yes this is a regression. with Bochs BIOS DOS 1.1x - 1.25 works fine.
The early DOS image is failing due to lack of stack space. It's calling int 1600 with ~150 bytes of stack space and SeaBIOS uses more.
-Kevin
On Sat, Mar 13, 2010 at 02:30:31PM +0800, Roy Tam wrote:
mouse problem affects Hydrogen OS too. http://tommy.planet.free.fr/doku.php?id=hydrogen_os
SeaBIOS turns mouse irqs on by default - the above image doesn't like that.
-Kevin