Hello all,[...]
I'm planning to resume work on my partly written 8086 emulator after a
long hiatus. I want to add the ability to read a file, but I'm having some difficulty
Is there a good resource to understand how this all should work?
Hello all,
I'm planning to resume work on my partly written 8086 emulator after a
long hiatus. I want to add the ability to read a file, but I'm having some difficulty
understanding how it's supposed to work under MS-DOS. I've found the
listing of int 13h in Ralf Brown's Interrupt List (http://www.ctyme.com/intr/cat-003.htm)
but it all seems very complicated and perhaps unnecessary.
For the simplest working test, I think I can skip the CHS addressing and
just use Logical Block Addressing with a single "disk" file on the host.
Is there a good resource to understand how this all should work?
I need to implement the BIOS routines and call host functions, probably
just mmap'ing the file and using memcpy for both read and write.
I have this sort of thing partly working for keyboard read and and screen write by using ESC instructions in the BIOS routines. The emulator
implements the ESC instructions to call host functions getchar() and putchar().
luser...@nospicedham.gmail.com <luser...@nospicedham.gmail.com> wrote:
Hello all,
I'm planning to resume work on my partly written 8086 emulator after a
long hiatus. I want to add the ability to read a file, but I'm having some difficulty
understanding how it's supposed to work under MS-DOS. I've found the listing of int 13h in Ralf Brown's Interrupt List (http://www.ctyme.com/intr/cat-003.htm)
but it all seems very complicated and perhaps unnecessary.
For the simplest working test, I think I can skip the CHS addressing and just use Logical Block Addressing with a single "disk" file on the host.
Is there a good resource to understand how this all should work?
I need to implement the BIOS routines and call host functions, probably just mmap'ing the file and using memcpy for both read and write.Basic question is what do you want to emulate? 8086 by itself can not
I have this sort of thing partly working for keyboard read and and screen write by using ESC instructions in the BIOS routines. The emulator implements the ESC instructions to call host functions getchar() and putchar().
do file I/O. You may do PC emulator in style of Bochs, that is
emulate common hardware. You may do BIOS emulator. You may
do DOS emulator, that is emulate file I/O at DOS level. Or
you may emulate different system. For example QEMU 386 emulates
Linux system calls. If you want your emulator to be simple,
you may define your own system calls (say using something like INT 0x80h), thing like open, close, read, write. Advantage is simplicity.
Disadvantage is that large body of existing 8086 assembler programs
assumes DOS environment and will not work with different system.
On Monday, May 24, 2021 at 8:40:27 PM UTC-5, anti...@nospicedham.math.uni.wroc.pl wrote:
luser...@nospicedham.gmail.com <luser...@nospicedham.gmail.com> wrote:
Basic question is what do you want to emulate? 8086 by itself can not
do file I/O. You may do PC emulator in style of Bochs, that is
emulate common hardware. You may do BIOS emulator. You may
do DOS emulator, that is emulate file I/O at DOS level. Or
you may emulate different system. For example QEMU 386 emulates
Linux system calls. If you want your emulator to be simple,
you may define your own system calls (say using something like INT 0x80h), >> thing like open, close, read, write. Advantage is simplicity.
Disadvantage is that large body of existing 8086 assembler programs
assumes DOS environment and will not work with different system.
Very good points. Thanks. You're right that the 8086 by itself only has in/out instructions, ESC instructions, and memory mapped IO, all of which depend on the rest of the system. It appears that the IBM BIOS operates
at the very low level of clusters, heads, and sectors. But the DOS functions appear to map pretty closely to stdio.h functions. So that seems to be
the easiest path forward.
My goal at this stage is just to get some kind of read/write ability
so the Forth interpreter can read Forth source from a file. So far,
all my Forth code is written in a sort of "pre-compiled" form
directly in the C code that implements the CPU emulator.
On 26/05/2021 23:33, luser...@nospicedham.gmail.com wrote:
Very good points. Thanks. You're right that the 8086 by itself only has in/out instructions, ESC instructions, and memory mapped IO, all of which depend on the rest of the system. It appears that the IBM BIOS operatesThere's a guy on alt.os.development who has been posting about very much
at the very low level of clusters, heads, and sectors. But the DOS functions
appear to map pretty closely to stdio.h functions. So that seems to be
the easiest path forward.
the same sorts of thing. Maybe there's value in the two of you getting
in touch, if you aren't already.
On Sunday, May 16, 2021 at 3:48:21 PM UTC-5, luser...@nospicedham.gmail.com wrote:
Hello all,
I'm planning to resume work on my partly written 8086 emulator after a[...]
long hiatus. I want to add the ability to read a file, but I'm having some difficulty
Is there a good resource to understand how this all should work?I suppose this isn't really related to assembly language. I've ordered Peter Norton's
Guide to the IBM PC. I guess I'll post in comp.os.msdos.programmer if I run into
trouble.
On Monday, May 24, 2021 at 1:22:49 AM UTC-5, luser...@nospicedham.gmail.com wrote:
On Sunday, May 16, 2021 at 3:48:21 PM UTC-5, luser...@nospicedham.gmail.com wrote:
Hello all,
For posterity, Norton's Guide really seems to be the perfect book to learn all aboutI'm planning to resume work on my partly written 8086 emulator after a long hiatus. I want to add the ability to read a file, but I'm having some[...]
difficulty
Is there a good resource to understand how this all should work?I suppose this isn't really related to assembly language. I've ordered Peter Norton's
Guide to the IBM PC. I guess I'll post in comp.os.msdos.programmer if I run into
trouble.
this stuff. It looks like I want to bypass DOS 1.0 stuff, too, and go straight for the DOS 2.0
additions to have a file handle and less fiddly business.
I suppose this isn't really related to assembly language.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 68:58:53 |
Calls: | 6,655 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,332,090 |
Posted today: | 1 |