VOGONS


Reply 60 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

My latest build, has some bugs fixed concerning the OSK not being hidden when disabled and an input menu to apply custom colors to the OSK (font/inactive border/active border and LED font/LED inactive border/LED active border) to customize your OSK to your needs (all colors have the 16 colors from the CGA palette). Square can be used to remove gaming mode key assignments and triangle is used, when selecting a color, to load the default color for the keyboard colors. The same applies to mounted disks, but they unmount the disk, since, by default, there is no disk mounted.

Filename
x86EMU_20150411_1500.zip
File size
437.01 KiB
Downloads
54 downloads
File comment
My latest x86EMU build.
File license
Fair use/fair dealing exception

The keyboard works simple:
It has three modes: The mouse mode, the keyboard mode and gaming mode (used for playing games).

- The mouse mode:
The analog stick is mapped for mouse movement in the given direction and speed(speed differences by pulling it to a side more or less only works with joysticks (PSP joystick or joystick on a PC)).
Square, Triangle and Circle are used for left, middle and right mouse button.
The ctrl, alt and shift keys are the same as on a keyboard.

- The keyboard mode:
The analog stick is used to select a block of 4 keys, for a total of 8 directions plus neutral state (not pulled to any direction). The keyboard is mapped like an actual keyboard on the OSK. Pull the analog stick to a direction to select an area (upperleft, up, upperright, left, centered, right, bottomleft, bottom, right are the areas).
The four face buttons (Square, Triangle, Cross and Circle) are used to press a key.
Left is mapped to Ctrl, Right is mapped to Alt, Up is mapped to ctrl and alt together, R is mapped to shift.
L switches between keyboard pages (3 pages total for an entire keyboard).

By pressing down in both mouse and keyboard mode, gaming mode is enabled.

- The gaming mode:
Almost all buttons are directly mapped to key presses. The only exception is SELECT, which exits the gaming mode and returns to the last used mode.

Ctrl is mapped in windows to the PSP's HOME button. This isn't yet supported on the PC, on the PSP it handles the normal program termination menu.

Regardless of the keyboard mappings, on Windows:
- ALT-F4 quits the application.
- F12 toggles fullscreen operations (still buggy, it makes the program hang atm after fullscreen is toggled by SDL_SetVideoMode).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 61 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

There's one problem with the BIOS from Bochs: It's for at least a 80286+. My emulator emulates a 80186 or 8086 (configurable) atm. 80286 is partly implemented (it's about a 80386 without any 80286 opcodes, real mode will work as a 80186, protected mode will work, without multitasking, 80286+ opcodes and protected mode interrupt support atm). Since the 80286+ isn't done yet, only 8086/80186 is currently selectable in the BIOS Menu. Programs written for a 8086 or 80186 will work, except for the found errors till now.

Any BIOS you can recommend to use for getting my CPU emulation right (which will work on 8086/80186 real mode)? So no 0x0F opcodes, nor any 80286+ opcodes or 32-bit opcodes. It has to be a BIOS that can run on a 80186 or 8086.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 62 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

This is my latest source code of my 80(1)86 emulation. Anyone knows what's going wrong here? (The CPU8086_OPXX/CPU186_OPXX functions are the actual opcode handlers, in opcodes_80(1)86.c.)

Filename
cpu_8086-80186_20150505_1403.zip
File size
18.05 KiB
Downloads
51 downloads
File comment
My latest 80(1)86 opcode handling.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 64 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

Anyone else can take a look at it? Anyone out there who has build an x86 emulator before? Maybe someone from the Dosbox team?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 65 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

My current log says this:

0:00:31:76.0.0565: Read 17/17 sectors from drive 00, start 126. Requested: Head: 1, Track: 3, Sector: 1. Start sector: 126, Destination: ES:BX=0690:00005400
0:00:31:84.3.0692: Function 02 called.
0:00:31:84.4.0957: Read 1/1 sectors from drive 00, start 1. Requested: Head: 0, Track: 0, Sector: 2. Start sector: 1, Destination: ES:BX=0968:00000010

The information you gave says 0986:10, not 968:10. So the program goes wrong between these two points?

The logs of interrupt 13h and debugger itself:

Filename
debuggerlog_20150711_1336.7z
File size
4.01 MiB
Downloads
50 downloads
File comment
Latest debugger and interrupt 13h logs.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 66 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

Is there anyone that can answer my question(s) active on this forum? Do you have time peterferrie? Or maybe anyone from the Dosbox/Bochs/QEMU team can help?

Edit: The error is supposed to happen before 0:04:57:44.0.0206 and after 0:03:25:05.4.0105 after looking at it. Anyone can find an error there?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 67 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

My latest log of my emulator. It seems to loop? Anyone can tell me more about what's going wrong? I can't find it...

Remove the ".zip" extension to use the archive and extract the log.

Filename
debuggerlog_20150717_1902.7z.001.zip
File size
2.38 MiB
Downloads
45 downloads
File comment
My latest debugger log, part 1.
File license
Fair use/fair dealing exception
Filename
debuggerlog_20150717_1902.7z.002.zip
File size
2.38 MiB
Downloads
43 downloads
File comment
My latest debugger log, part 2.
File license
Fair use/fair dealing exception
Filename
debuggerlog_20150717_1902.7z.003.zip
File size
2.38 MiB
Downloads
43 downloads
File comment
My latest debugger log, part 3.
File license
Fair use/fair dealing exception
Filename
debuggerlog_20150717_1902.7z.004.zip
File size
2.38 MiB
Downloads
47 downloads
File comment
My latest debugger log, part 4.
File license
Fair use/fair dealing exception
Filename
debuggerlog_20150717_1902.7z.005.zip
File size
2.16 MiB
Downloads
50 downloads
File comment
My latest debugger log, part 5.
File license
Fair use/fair dealing exception

The int10.log is now combined with the debugger.log file.

The latest source can be found at my project:
http://bitbucket.org/superfury/x86emu.git

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 68 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I now got the Turbo PC XT BIOS running up to the point it starts booting the floppy, but the DMA controller seems to go wrong: it doesn't seem to detect correctly when to start or stop. Anyone knows how the DMA controller operates (the differences between the 4 modes (Demand, SIngle, Block, Cascade(not used for transfers)))? How does the TC bits affect this?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 69 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

Afaik I now have my DMA and floppy controller fully working. After the BIOS starts booting, first sector 0 of floppy #0 is read to 0000:7C00. When MS-DOS tries to load the FAT, it reads sector 19 to address 0x500 (debugging the DMA controller addresses)? After that, it says the disk is not a system disk (MS-DOS 6.22 floppy).

Filename
debugger_MSDOS622_notbooting_20150720_1234.7z
File size
501.83 KiB
Downloads
45 downloads
File comment
My debugger log from the point the bootsector starts running.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 70 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've gotten MS-DOS running up to a certain point:

0:04:39:53.0.0508: Read from memory: 0009E7C8=00 ( )

0:04:39:53.0.0515: Read from memory: 0009E7C9=00 ( )

0:04:39:53.0.0525: Writing to memory: 0009E938=FD (ý)

0:04:39:53.0.0530: Writing to memory: 0009E939=9D ()

0:04:39:53.0.0536: Writing to memory: 0009E936=6F (o)

0:04:39:53.0.0541: Writing to memory: 0009E937=09 ( )

0:04:39:53.0.0548: Read from memory: 0009E7C8=00 ( )

0:04:39:53.0.0553: Read from memory: 0009E7C9=00 ( )

0:04:39:53.0.0559: Read from memory: 0009E7CA=56 (V)

0:04:39:53.0.0564: Read from memory: 0009E7CB=02 ()

0:04:39:53.0.0571: ModR/M address: 9DFD:07F8=0009E7C8

0:04:39:53.0.0618: 9DFD:096A (36FF1EF807)CALL [SS:07F8]

0:04:39:53.0.0624: Registers:

0:04:39:53.0.0629: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.0.0635: CS: 9DFD, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.0.0640: SP: 096A, BP: 0000, SI: 016E, DI: A000

0:04:39:53.0.0645: IP: 096A, FLAGS: F256

0:04:39:53.0.0655: FLAGSINFO:c1P0A0ZstIdo1111



0:04:39:53.0.0799: 0256:0000 (E90E72)JMP 7211

0:04:39:53.0.0804: Registers:

0:04:39:53.0.0810: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.0.0815: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.0.0820: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.0.0825: IP: 0000, FLAGS: F256

0:04:39:53.0.0835: FLAGSINFO:c1P0A0ZstIdo1111



0:04:39:53.0.0974: Read from memory: 000008DE=70 (p)

0:04:39:53.0.0982: Writing to memory: 000008DE=6D (m)

0:04:39:53.0.0988: ModR/M address: 0070:01DE=000008DE

Show last 212 lines
0:04:39:53.0.0994: 0256:7211 (0000)ADDB [DS:BX+SI],AL

0:04:39:53.0.0999: Registers:

0:04:39:53.1.0004: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.1.0009: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.1.0014: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.1.0019: IP: 7211, FLAGS: F256

0:04:39:53.1.0029: FLAGSINFO:c1P0A0ZstIdo1111



0:04:39:53.1.0163: Read from memory: 000008DE=6D (m)

0:04:39:53.1.0171: Writing to memory: 000008DE=6A (j)

0:04:39:53.1.0177: ModR/M address: 0070:01DE=000008DE

0:04:39:53.1.0183: 0256:7213 (0000)ADDB [DS:BX+SI],AL

0:04:39:53.1.0187: Registers:

0:04:39:53.1.0193: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.1.0198: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.1.0203: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.1.0208: IP: 7213, FLAGS: F203

0:04:39:53.1.0218: FLAGSINFO:C1p0a0zstIdo1111



0:04:39:53.1.0338: Read from memory: 000008DE=6A (j)

0:04:39:53.1.0345: Writing to memory: 000008DE=67 (g)

0:04:39:53.1.0351: ModR/M address: 0070:01DE=000008DE

0:04:39:53.1.0357: 0256:7215 (0000)ADDB [DS:BX+SI],AL

0:04:39:53.1.0361: Registers:

0:04:39:53.1.0367: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.1.0372: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.1.0377: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.1.0382: IP: 7215, FLAGS: F217

0:04:39:53.1.0392: FLAGSINFO:C1P0A0zstIdo1111



0:04:39:53.1.0511: Read from memory: 000008DE=67 (g)

0:04:39:53.1.0518: Writing to memory: 000008DE=64 (d)

0:04:39:53.1.0524: ModR/M address: 0070:01DE=000008DE

0:04:39:53.1.0530: 0256:7217 (0000)ADDB [DS:BX+SI],AL

0:04:39:53.1.0534: Registers:

0:04:39:53.1.0540: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.1.0545: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.1.0550: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.1.0555: IP: 7217, FLAGS: F213

0:04:39:53.1.0565: FLAGSINFO:C1p0A0zstIdo1111



0:04:39:53.1.0684: Read from memory: 000008DE=64 (d)

0:04:39:53.1.0691: Writing to memory: 000008DE=61 (a)

0:04:39:53.1.0697: ModR/M address: 0070:01DE=000008DE

0:04:39:53.1.0703: 0256:7219 (0000)ADDB [DS:BX+SI],AL

0:04:39:53.1.0707: Registers:

0:04:39:53.1.0712: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.1.0718: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.1.0723: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.1.0728: IP: 7219, FLAGS: F213

0:04:39:53.1.0738: FLAGSINFO:C1p0A0zstIdo1111



0:04:39:53.1.0895: Read from memory: 000008DE=61 (a)

0:04:39:53.1.0902: Writing to memory: 000008DE=5E (^)

0:04:39:53.1.0908: ModR/M address: 0070:01DE=000008DE

0:04:39:53.1.0914: 0256:721B (0000)ADDB [DS:BX+SI],AL

0:04:39:53.1.0918: Registers:

0:04:39:53.1.0923: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.1.0929: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.1.0934: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.1.0939: IP: 721B, FLAGS: F213

0:04:39:53.1.0949: FLAGSINFO:C1p0A0zstIdo1111



0:04:39:53.2.0068: Read from memory: 000008DE=5E (^)

0:04:39:53.2.0077: Writing to memory: 000008DE=5B ([)

0:04:39:53.2.0084: ModR/M address: 0070:01DE=000008DE

0:04:39:53.2.0089: 0256:721D (0000)ADDB [DS:BX+SI],AL

0:04:39:53.2.0093: Registers:

0:04:39:53.2.0099: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.2.0104: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.2.0110: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.2.0114: IP: 721D, FLAGS: F203

0:04:39:53.2.0124: FLAGSINFO:C1p0a0zstIdo1111



0:04:39:53.2.0243: Read from memory: 000008DE=5B ([)

0:04:39:53.2.0250: Writing to memory: 000008DE=58 (X)

0:04:39:53.2.0257: ModR/M address: 0070:01DE=000008DE

0:04:39:53.2.0263: 0256:721F (0000)ADDB [DS:BX+SI],AL

0:04:39:53.2.0267: Registers:

0:04:39:53.2.0272: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.2.0278: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.2.0283: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.2.0287: IP: 721F, FLAGS: F213

0:04:39:53.2.0297: FLAGSINFO:C1p0A0zstIdo1111



0:04:39:53.2.0416: Read from memory: 000008DE=58 (X)

0:04:39:53.2.0423: Writing to memory: 000008DE=55 (U)

0:04:39:53.2.0430: ModR/M address: 0070:01DE=000008DE

0:04:39:53.2.0436: 0256:7221 (0000)ADDB [DS:BX+SI],AL

0:04:39:53.2.0440: Registers:

0:04:39:53.2.0445: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.2.0451: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.2.0456: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.2.0461: IP: 7221, FLAGS: F213

0:04:39:53.2.0471: FLAGSINFO:C1p0A0zstIdo1111



0:04:39:53.2.0591: Read from memory: 000008DE=55 (U)

0:04:39:53.2.0598: Writing to memory: 000008DE=52 (R)

0:04:39:53.2.0604: ModR/M address: 0070:01DE=000008DE

0:04:39:53.2.0610: 0256:7223 (0000)ADDB [DS:BX+SI],AL

0:04:39:53.2.0614: Registers:

0:04:39:53.2.0619: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:04:39:53.2.0625: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:04:39:53.2.0630: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:04:39:53.2.0635: IP: 7223, FLAGS: F217

0:04:39:53.2.0645: FLAGSINFO:C1P0A0zstIdo1111

After this it's running empty or cleared memory?

Filename
debugger_20150720_1722_split.7z.001.txt
File size
2.86 MiB
Downloads
46 downloads
File comment
The first part of the debugger log. Rename to .7z.001
File license
Fair use/fair dealing exception
Filename
debugger_20150720_1722_split.7z.002.txt
File size
2.76 MiB
Downloads
48 downloads
File comment
The second part of the debugger log. Rename to .7z.002
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 71 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++
peterferrie wrote:
I'll have to investigate later what you're seeing. However, if you see reads to segment 0x70 while running from segment 0x70, t […]
Show full quote

I'll have to investigate later what you're seeing. However, if you see reads to segment 0x70 while running from segment 0x70, then that's your problem.
These are the reads that you should see:
9ea0:0 (9 sectors)
690:0 (6)
690:c00 (0x12)
690:3000 (0x12)
690:5400 (0x11)
986:10 (1)
b72:10 (1)
b72:10 (1)
b51:10 (1)
c8b:0 (1)
c8b:200 (0x12)
c8b:2600 (0x12)
c8b:4a00 (0x0c)
b30:10 (1)

My emulator isn't currently loading anything at those locations. Are you actually talking about MS-DOS 3.3 here?

This is the dump log of the very first sector read (after calculation and a INT13 Reset call(function 0)):

0:01:04:09.3.0282: Writing to memory: 00007BF2=02 ()

0:01:04:09.3.0288: Writing to memory: 00007BF3=F2 (ò)

0:01:04:09.3.0294: Writing to memory: 00007BF0=00 ( )

0:01:04:09.3.0299: Writing to memory: 00007BF1=00 ( )

0:01:04:09.3.0338: Writing to memory: 00007BEE=76 (v)

0:01:04:09.3.0343: Writing to memory: 00007BEF=7D (})

0:01:04:09.3.0349: Read from memory: 0000004C=59 (Y)

0:01:04:09.3.0354: Read from memory: 0000004D=EC (ì)

0:01:04:09.3.0359: Read from memory: 0000004E=00 ( )

0:01:04:09.3.0364: Read from memory: 0000004F=F0 (ð)

0:01:04:09.3.0372: 0000:7D74 (CD13)INT 13

0:01:04:09.3.0376: Registers:

0:01:04:09.3.0381: AX: 0201, BX: 0500, CX: 0002, DX: 0100

0:01:04:09.3.0386: CS: 0000, DS: 0000, ES: 0000, SS: 0000

0:01:04:09.3.0392: SP: 7BF4, BP: 0000, SI: EFD2, DI: 7C36

0:01:04:09.3.0397: IP: 7D74, FLAGS: F202

0:01:04:09.3.0406: FLAGSINFO:c1p0a0zstIdo1111

So it reads the first FAT entry to ES:BX=0000:0500, not 9EA0:0000. Can you tell me why this happens? As far as I can see at a certain point in the boot loader:

0:01:04:08.8.0678: 0000:7CB9 (BB0005)MOVW BX, 0500

0:01:04:08.8.0683: Registers:

0:01:04:08.8.0688: AX: 0013, BX: 0200, CX: 0009, DX: 0000

0:01:04:08.8.0693: CS: 0000, DS: 0000, ES: 0000, SS: 0000

0:01:04:08.8.0699: SP: 7BF8, BP: 0000, SI: EFD2, DI: 7C36

0:01:04:08.8.0703: IP: 7CB9, FLAGS: F202

0:01:04:08.8.0713: FLAGSINFO:c1p0a0zstIdo1111

Which explains the offset of 0x500.

And also:

0:01:04:08.1.0866: Read from memory: 00007BE8=00 ( )

0:01:04:08.1.0873: Read from memory: 00007BE9=00 ( )

0:01:04:08.1.0880: F000:ECA2 (07)POP ES

0:01:04:08.1.0884: Registers:

0:01:04:08.1.0889: AX: 0002, BX: 0078, CX: 0000, DX: 0000

0:01:04:08.1.0894: CS: F000, DS: 0040, ES: 0000, SS: 0000

0:01:04:08.1.0971: SP: 7BE8, BP: 7BDC, SI: 7C2B, DI: 0000

0:01:04:08.1.0976: IP: ECA2, FLAGS: F296

0:01:04:08.1.0986: FLAGSINFO:c1P0A0zStIdo1111

Loads ES, which is the destination of the first floppy sector read.

This value was pushed here:

0:01:04:03.0.0053: Writing to memory: 00007BE8=00 ( )

0:01:04:03.0.0059: Writing to memory: 00007BE9=00 ( )

0:01:04:03.0.0066: F000:EC5E (06)PUSH ES

0:01:04:03.0.0069: Registers:

0:01:04:03.0.0074: AX: 0000, BX: 0078, CX: 0000, DX: 0000

0:01:04:03.0.0080: CS: F000, DS: 0000, ES: 0000, SS: 0000

0:01:04:03.0.0085: SP: 7BEA, BP: 0000, SI: EFD2, DI: 7C36

0:01:04:03.0.0089: IP: EC5E, FLAGS: F246

0:01:04:03.0.0099: FLAGSINFO:c1P0a0ZstIdo1111

Above happens in the first INT 13 call.

That ES value came from:

0:01:04:01.4.0816: Writing to memory: 00007BFE=00 ( )

0:01:04:01.4.0822: Writing to memory: 00007BFF=00 ( )

0:01:04:01.4.0829: 0000:7C3E (16)PUSH SS

0:01:04:01.4.0833: Registers:

0:01:04:01.4.0838: AX: 0000, BX: 7C00, CX: 0001, DX: 0000

0:01:04:01.4.0843: CS: 0000, DS: 0000, ES: 0000, SS: 0000

0:01:04:01.4.0848: SP: 7C00, BP: 0000, SI: EC54, DI: 0400

0:01:04:01.4.0853: IP: 7C3E, FLAGS: F056

0:01:04:01.4.0862: FLAGSINFO:c1P0A0Zstido1111



0:01:04:01.4.0976: Read from memory: 00007BFE=00 ( )

0:01:04:01.4.0982: Read from memory: 00007BFF=00 ( )

0:01:04:01.4.0989: 0000:7C3F (07)POP ES

0:01:04:01.4.0993: Registers:

0:01:04:01.4.0998: AX: 0000, BX: 7C00, CX: 0001, DX: 0000

0:01:04:01.5.0003: CS: 0000, DS: 0000, ES: 0000, SS: 0000

0:01:04:01.5.0009: SP: 7BFE, BP: 0000, SI: EC54, DI: 0400

0:01:04:01.5.0013: IP: 7C3F, FLAGS: F056

0:01:04:01.5.0023: FLAGSINFO:c1P0A0Zstido1111

This ES value was gotten from the SS value, which in turn came from:

0:01:04:01.4.0364: 0000:7C37 (33C0)XORW AX,AX

0:01:04:01.4.0368: Registers:

0:01:04:01.4.0374: AX: 00FF, BX: 7C00, CX: 0001, DX: 0000

0:01:04:01.4.0379: CS: 0000, DS: 0000, ES: 0000, SS: 0030

0:01:04:01.4.0384: SP: 00F8, BP: 0000, SI: EC54, DI: 0400

0:01:04:01.4.0389: IP: 7C37, FLAGS: F096

0:01:04:01.4.0398: FLAGSINFO:c1P0A0zStido1111



0:01:04:01.4.0518: 0000:7C39 (8ED0)MOVW SS,AX

0:01:04:01.4.0523: Registers:

0:01:04:01.4.0528: AX: 0000, BX: 7C00, CX: 0001, DX: 0000

0:01:04:01.4.0533: CS: 0000, DS: 0000, ES: 0000, SS: 0030

0:01:04:01.4.0538: SP: 00F8, BP: 0000, SI: EC54, DI: 0400

0:01:04:01.4.0543: IP: 7C39, FLAGS: F056

0:01:04:01.4.0552: FLAGSINFO:c1P0A0Zstido1111

At the start of the boot sector (straight after the JMP 7C36 and CLI command at the start of the boot sector).

So where does your 9ea0:0 address come from?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 72 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I do notice that the memory is correctly detected by INT12:

0:01:53:92.2.0839: Read from memory: 000006F6=14 ()

0:01:53:92.2.0845: Read from memory: 000006F7=36 (6)

0:01:53:92.2.0851: Read from memory: 000006F8=70 (p)

0:01:53:92.2.0856: Read from memory: 000006F9=00 ( )

0:01:53:92.2.0861: Read from memory: 000006FA=02 ()

0:01:53:92.2.0866: Read from memory: 000006FB=F0 (ð)

0:01:53:92.2.0873: F000:F84C (CF)IRET

0:01:53:92.2.0876: Registers:

0:01:53:92.2.0882: AX: 0280, BX: 078C, CX: 0000, DX: 0000

0:01:53:92.2.0887: CS: F000, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.2.0893: SP: 06F6, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.2.0897: IP: F84C, FLAGS: F202

0:01:53:92.2.0907: FLAGSINFO:c1p0a0zstIdo1111



0:01:53:92.3.0175: 0070:3614 (B106)MOVB CL, 06

0:01:53:92.3.0181: Registers:

0:01:53:92.3.0186: AX: 0280, BX: 078C, CX: 0000, DX: 0000

0:01:53:92.3.0191: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.3.0372: SP: 06FC, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.3.0377: IP: 3614, FLAGS: F002

0:01:53:92.3.0386: FLAGSINFO:c1p0a0zstido1111



0:01:53:92.3.0665: 0070:3616 (D3E0)SHLW AX,CL

0:01:53:92.3.0670: Registers:

0:01:53:92.3.0675: AX: 0280, BX: 078C, CX: 0006, DX: 0000

0:01:53:92.3.0680: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.3.0686: SP: 06FC, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.3.0690: IP: 3616, FLAGS: F002

0:01:53:92.3.0700: FLAGSINFO:c1p0a0zstido1111



Show last 60 lines
0:01:53:92.3.0957: Read from memory: 000006FC=00 ( )

0:01:53:92.3.0963: Read from memory: 000006FD=F0 (ð)

0:01:53:92.3.0970: 0070:3618 (59)POP CX

0:01:53:92.3.0974: Registers:

0:01:53:92.3.0979: AX: A000, BX: 078C, CX: 0006, DX: 0000

0:01:53:92.3.0984: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.3.0990: SP: 06FC, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.3.0994: IP: 3618, FLAGS: F886

0:01:53:92.4.0004: FLAGSINFO:c1P0a0zStidO1111



0:01:53:92.4.0141: Writing to memory: 00003A76=00 ( )

0:01:53:92.4.0148: Writing to memory: 00003A77=F0 (ð)

0:01:53:92.4.0154: ModR/M address: 0070:3376=00003A76

0:01:53:92.4.0162: 0070:3619 (2E890E7633)MOVW [CS:3376],CX

0:01:53:92.4.0166: Registers:

0:01:53:92.4.0172: AX: A000, BX: 078C, CX: F000, DX: 0000

0:01:53:92.4.0177: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.4.0183: SP: 06FE, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.4.0188: IP: 3619, FLAGS: F886

0:01:53:92.4.0197: FLAGSINFO:c1P0a0zStidO1111



0:01:53:92.4.0334: Writing to memory: 000006FC=00 ( )

0:01:53:92.4.0341: Writing to memory: 000006FD=A0 ( )

0:01:53:92.4.0347: 0070:361E (50)PUSH AX

0:01:53:92.4.0351: Registers:

0:01:53:92.4.0357: AX: A000, BX: 078C, CX: F000, DX: 0000

0:01:53:92.4.0362: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.4.0367: SP: 06FE, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.4.0378: IP: 361E, FLAGS: F886

0:01:53:92.4.0388: FLAGSINFO:c1P0a0zStidO1111

According to this, it should load below A000:0000, or address A0000(start of VRAM).

Yet, the 9ea0:0 address still won't be generated for the read. Anyone can tell me why?

I see it being read here:

0:01:53:92.7.0782: Read from memory: 000006FC=00 ( )

0:01:53:92.7.0788: Read from memory: 000006FD=A0 ( )

0:01:53:92.7.0794: 0070:3649 (58)POP AX

0:01:53:92.7.0798: Registers:

0:01:53:92.7.0804: AX: 9EE0, BX: 078C, CX: F000, DX: 0120

0:01:53:92.7.0809: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.7.0814: SP: 06FC, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.7.0819: IP: 3649, FLAGS: F082

0:01:53:92.7.0829: FLAGSINFO:c1p0a0zStido1111



0:01:53:92.7.0952: 0070:364A (BA8D04)MOVW DX, 048D

0:01:53:92.7.0957: Registers:

0:01:53:92.7.0962: AX: A000, BX: 078C, CX: F000, DX: 0120

0:01:53:92.7.0967: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.7.0973: SP: 06FE, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.7.0978: IP: 364A, FLAGS: F082

0:01:53:92.7.0987: FLAGSINFO:c1p0a0zStido1111



0:01:53:92.8.0116: 0070:364D (8EDA)MOVW DS,DX

0:01:53:92.8.0121: Registers:

0:01:53:92.8.0126: AX: A000, BX: 078C, CX: F000, DX: 048D

0:01:53:92.8.0132: CS: 0070, DS: 0000, ES: 0000, SS: 0000

0:01:53:92.8.0137: SP: 06FE, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.8.0142: IP: 364D, FLAGS: F082

0:01:53:92.8.0152: FLAGSINFO:c1p0a0zStido1111

Written to memory here:


0:01:53:92.8.0664: Writing to memory: 000050DC=00 ( )

0:01:53:92.8.0671: Writing to memory: 000050DD=A0 ( )

0:01:53:92.8.0678: 0070:3659 (A30C08)MOVW [DS:080C],AX

0:01:53:92.8.0682: Registers:

0:01:53:92.8.0688: AX: A000, BX: 078C, CX: F000, DX: 048D

0:01:53:92.8.0693: CS: 0070, DS: 048D, ES: 0000, SS: 0000

0:01:53:92.8.0699: SP: 06FE, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:92.8.0703: IP: 3659, FLAGS: F082

0:01:53:92.8.0713: FLAGSINFO:c1p0a0zStido1111

Compared with (BIOS?) here:


0:01:53:93.1.0937: Read from memory: 000050DC=00 ( )

0:01:53:93.1.0943: Read from memory: 000050DD=A0 ( )

0:01:53:93.1.0951: ModR/M address: 048D:080C=000050DC

0:01:53:93.1.0959: 0070:3689 (263B060C08)CMPW AX,[ES:080C]

0:01:53:93.1.0963: Registers:

0:01:53:93.1.0968: AX: F000, BX: 078C, CX: F001, DX: 048D

0:01:53:93.1.0974: CS: 0070, DS: 0000, ES: 048D, SS: 0000

0:01:53:93.1.0979: SP: 06FC, BP: 7BE2, SI: 7C36, DI: 052D

0:01:53:93.1.0984: IP: 3689, FLAGS: F046

0:01:53:93.1.0994: FLAGSINFO:c1P0a0Zstido1111

Moved into CX here:


0:02:17:11.4.0278: Read from memory: 000050DC=00 ( )

0:02:17:11.4.0284: Read from memory: 000050DD=A0 ( )

0:02:17:11.4.0291: ModR/M address: 048D:080C=000050DC

0:02:17:11.4.0298: 048D:0922 (2E8B0E0C08)MOVW CX,[CS:080C]

0:02:17:11.4.0302: Registers:

0:02:17:11.4.0308: AX: F0FE, BX: 0070, CX: 0000, DX: 0070

0:02:17:11.4.0313: CS: 048D, DS: F000, ES: 0070, SS: 0000

0:02:17:11.4.0318: SP: 0700, BP: 0000, SI: 0000, DI: 0000

0:02:17:11.4.0323: IP: 0922, FLAGS: F046

0:02:17:11.4.0333: FLAGSINFO:c1P0a0Zstido1111

Copied to high memory at this point:

0:02:17:26.5.0572: Read from memory: 000050DC=00 ( )

0:02:17:26.5.0578: Read from memory: 000050DD=A0 ( )

0:02:17:26.5.0584: Writing to memory: 0009E7DC=00 ( )

0:02:17:26.5.0589: Writing to memory: 0009E7DD=A0 ( )

During this instruction:

0:02:17:11.6.0641: Read from memory: 000048D0=00 ( )

0:02:17:11.6.0648: Read from memory: 000048D1=00 ( )

0:02:17:11.6.0653: Writing to memory: 0009DFD0=00 ( )

0:02:17:11.6.0658: Writing to memory: 0009DFD1=00 ( )

0:02:17:11.6.0665: 048D:093A (F3A5)REP MOVSW

0:02:17:11.6.0669: Registers:

0:02:17:11.6.0674: AX: 0203, BX: 0070, CX: 1018, DX: 0070

0:02:17:11.6.0680: CS: 048D, DS: 048D, ES: 9DFD, SS: 0000

0:02:17:11.6.0685: SP: 0700, BP: 0000, SI: 0000, DI: 0000

0:02:17:11.6.0690: IP: 093A, FLAGS: F016

0:02:17:11.6.0699: FLAGSINFO:c1P0A0zstido1111

Anyone can verify if this is correct?

As far as I can see it relocates IO.SYS from segment 0x48D to 0x9DFD(0x203 words before start of VRAM). Anyone can verify if this is correct?

Btw how much memory is installed in your environment? My BIOS returns 640K installed, which, after substracting the IO.SYS calculated information, is used as a relocation segment (segment 0x9DFD for IO.SYS).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 73 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

So eventually it calls an address called "MSDOS", according to the MS-DOS 3.30a source code (SYSINIT1.ASM). First, it executes a JMP to


0:02:29:15.3.0854: Read from memory: 0009E7C8=00 ( )

0:02:29:15.3.0860: Read from memory: 0009E7C9=00 ( )

0:02:29:15.3.0871: Writing to memory: 0009E938=FD (ý)

0:02:29:15.3.0876: Writing to memory: 0009E939=9D ()

0:02:29:15.3.0881: Writing to memory: 0009E936=6F (o)

0:02:29:15.3.0887: Writing to memory: 0009E937=09 ( )

0:02:29:15.3.0893: Read from memory: 0009E7C8=00 ( )

0:02:29:15.3.0898: Read from memory: 0009E7C9=00 ( )

0:02:29:15.3.0904: Read from memory: 0009E7CA=56 (V)

0:02:29:15.3.0909: Read from memory: 0009E7CB=02 ()

0:02:29:15.3.0916: ModR/M address: 9DFD:07F8=0009E7C8

0:02:29:15.3.0923: 9DFD:096A (36FF1EF807)CALL [SS:07F8]

0:02:29:15.3.0928: Registers:

0:02:29:15.3.0933: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:02:29:15.3.0939: CS: 9DFD, DS: 0070, ES: 0256, SS: 9DFD

0:02:29:15.3.0944: SP: 096A, BP: 0000, SI: 016E, DI: A000

0:02:29:15.3.0949: IP: 096A, FLAGS: F256

0:02:29:15.3.0958: FLAGSINFO:c1P0A0ZstIdo1111



0:02:29:15.4.0072: 0256:0000 (E90E72)JMP 7211

0:02:29:15.4.0077: Registers:

0:02:29:15.4.0083: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:02:29:15.4.0089: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:02:29:15.4.0094: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:02:29:15.4.0098: IP: 0000, FLAGS: F256

0:02:29:15.4.0108: FLAGSINFO:c1P0A0ZstIdo1111



0:02:29:15.4.0226: Read from memory: 000008DE=70 (p)

0:02:29:15.4.0233: Writing to memory: 000008DE=6D (m)

0:02:29:15.4.0240: ModR/M address: 0070:01DE=000008DE
Show last 14 lines

0:02:29:15.4.0246: 0256:7211 (0000)ADDB [DS:BX+SI],AL

0:02:29:15.4.0250: Registers:

0:02:29:15.4.0255: AX: 9DFD, BX: 0070, CX: 0000, DX: A000

0:02:29:15.4.0261: CS: 0256, DS: 0070, ES: 0256, SS: 9DFD

0:02:29:15.4.0266: SP: 0966, BP: 0000, SI: 016E, DI: A000

0:02:29:15.4.0271: IP: 7211, FLAGS: F256

0:02:29:15.4.0281: FLAGSINFO:c1P0A0ZstIdo1111

When I open MSDOS.SYS in a hex editor, the JMP 7211(bytes E9,0E,72) match the first three bytes of MSDOS.SYS. After that it starts executing NULL bytes (unfilled memory or cleared memory). Anyone can see what's going wrong here?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 74 of 87, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

As mentioned previously, I'm using BOCHS BIOS, which uses the Extended BIOS Area at 9FC0, so all segment values will be shifted a bit. The point of the earlier post was the number of sectors being read.
However, to your most recent question:

0:04:16:28.7.0410: 0070:0F57 (CD13)INT 13
0:04:16:28.7.0413: Registers:
0:04:16:28.7.0418: AX: 0209, BX: 0000, CX: 0002, DX: 0000
0:04:16:28.7.0424: CS: 0070, DS: 0070, ES: 9EE0, SS: 0000
0:04:16:28.7.0429: SP: 06F2, BP: 0005, SI: 0522, DI: 0482
0:04:16:28.7.0434: IP: 0F57, FLAGS: F246
0:04:16:28.7.0444: FLAGSINFO:c1P0a0ZstIdo1111

This call fails, and appears to be the cause of everything that goes wrong after that.

Reply 75 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I notice that it has something to do with my handling of the "max sector size" byte of the floppy disk read command:

		FLOPPY.databuffersize = translateSectorSize(FLOPPY.commandbuffer[5]); //Sector size into data buffer!
if (!FLOPPY.commandbuffer[5]) //Special case? Use given info!
{
FLOPPY.databuffersize = FLOPPY.commandbuffer[8]; //Use data length!
}
FLOPPY.disk_startpos = floppy_LBA(FLOPPY.DOR.DriveNumber, FLOPPY.commandbuffer[3], FLOPPY.commandbuffer[2], FLOPPY.commandbuffer[4]); //The start position, in sectors!
FLOPPY_LOG("FLOPPY: Read sector #%i", FLOPPY.disk_startpos) //We're reading this sector!
FLOPPY.disk_startpos *= FLOPPY.databuffersize;
FLOPPY_LOG("FLOPPY: Requesting transfer for %i sectors.", FLOPPY.commandbuffer[6]); //Transfer this many sectors!
FLOPPY.databuffersize *= FLOPPY.commandbuffer[6]; //How many sectors to transfer!

I notice that in the case you mentioned, FLOPPY.commandbuffer[6] contains 0x09 (the AL byte set during the INT13 call, how many sectors to transfer). But the other calls have large values in the amount of sectors to transfer (0x12 in the other cases, 0x08 when reading the boot sector by the BIOS). How should I handle this?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 76 of 87, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

Hmm, the issue appears to be that a loop is timing out while waiting for 3d4 to return some status bits.
Check the ROM disassembly to see it. It's right before the STC instruction.

Reply 77 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've updated the FDC to better represent the command status bits in the MSR (the high 3 bits), depending on the current state of execution (command byte, parameters, data(execution phase? data transfer using DMA or PIO), result and error(essentially the result phase, but with only 1 result byte: ST0)). It now seems to send the commands correctly and retrieves the whole result during read commands (command x6h).

This is my latest executable (run after setting it up (press backspace before the yellow option text disappears after starting it, the controls are as said a few posts back)). Enable BIOS mode and put the BIOS ROM (in my case the Turbo XT BIOS 2.5 and VGA BIOS from fake86 emulator (Tseng BIOS afaik (looking using hex editor says: "This is not } a product of IBM (IBM is a trademark of International Business Machines Corp.) ë[ * Copyright(c)1988 Tseng Laboratories, Inc. 01/10/92 V8.02X", guess it's a Tseng VGA BIOS? Don't know which one exactly.)))

Put the ROMs in ROM/BIOSROM.BIN (Turbo XT BIOS) and ROM/OPTROM.1 (Tseng VGA BIOS).

The executable:

Filename
x86EMU.exe
File size
625 KiB
Downloads
42 downloads
File comment
My latest build of my x86EMU.
File license
Fair use/fair dealing exception

It will automatically start logging once it hits the boot sector (0000:7C00) during execution, after the BIOS.

Can you see why it starts executing unfilled data (0000 instructions)?

Last edited by superfury on 2015-07-28, 14:34. Edited 1 time in total.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 78 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

Currently optimized CPU emulation is now running at 7 MIPS on a 2GHz Dual Core CPU.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 79 of 87, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've fixed the FDC and DMA. It now correctly loads requested sectors (tested with DMA only). For some reason it doesn't continue to load MS-DOS 3.3? Anyone can see what's going wrong here?

Here's the full emulator with required files (BIOS ROMs, Disk image and settings(BIOS.DAT)). Just run the executable to generate the log in logs/debugger.log (floppy disk is logged to logs/floppy.log and logs/debugger.log(double logging to find errors)). The logs/debugger.log file contains the instructions executed after arriving at the Boot Sector (at 0000:7C00).

Filename
x86EMU_20150728_1628.zip
File size
309.99 KiB
Downloads
64 downloads
File comment
My latest build of my x86EMU (build 2015/07/28 16:28).
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io