User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

8086tiny

Tue Jan 28, 2014 2:14 pm

Hi folks;
Just doing a post about this emulator, written by Adrian Cable. It's an open source (MIT license) 8086 emulator and is less than 32K compiled, it obviously can't do as much as DosBox but it can run certain things. The source may help people to develop their own emulation projects maybe?

Anyway, this may be offered as a package in the Raspbian repo in the future but for now you can just download it and compile it out of the box.

Check out: http://www.megalith.co.uk/8086tiny/

How to

Code: Select all

mkdir tiny
cd tiny
wget http://www.megalith.co.uk/8086tiny/downloads/8086tiny_103.tar.bz2
tar -xvf 8086tiny_103.tar.bz2
Check the above URL on their downloads page for new versions.
You'll need SDL 1.2 dev package installed in order to compile.

Code: Select all

sudo apt-get install libsdl1.2-dev
To compile just run;

Code: Select all

make
This won't take too long. Then to run the emulator just run;

Code: Select all

./runme
This will boot from a floppy disk image, so you'll end up at A:/>_
To exit the emulator you type the following at the A drive prompt.

Code: Select all

quitemu
Make a hard disk
So you'll probably need a way to get programs into the emulation environment to run. To do that we can make a blank disk image, use the emulator to partition and format it and then we can mount it under Linux to access its file system.

Use dd to make a blank image file full of zeros. If you name it hd.img the runme shell script will test for it.

Code: Select all

dd if=/dev/zero of=./hd.img bs=1024K count=128
This will make a 128 MB disk, give it a moment or two to write the file to disk. Then go back into the emulator again.

Code: Select all

./runme
The emulator will now complain about an illegal partition table but will still allow you to boot from the floppy disk image.
When you get to the A drive prompt run fdisk.

Code: Select all

fdisk
Say no to large disk support: N
Enter 1 to create a DOS partition or logical drive
Enter 1 to create a primary DOS partition
Say yes to all available space and make active: Y
Escape
Escape
Now quit the emulator and restart it.

Code: Select all

quitemu
./runme
You should now see the illegal partition warning is gone and that a line of info about C: is shown.
When you get to the A drive prompt enter the following to format the C drive.

Code: Select all

format c: /s
Type Y E S and press enter. Give it a volume label, say DOS. The format will be quite quick.
When you're back at the A drive prompt you'll be able to go onto the C drive.

Code: Select all

C:
dir
You should see KERNEL.SYS and COMMAND.COM.
Now close down the emulator and we'll mount the disk under Linux so that we can copy files onto it.

Code: Select all

A:
quitemu
Run the following command to inspect the file.

Code: Select all

fdisk -lu hd.img
The output should look something like this;

Code: Select all

Disk hd.img: 134 MB, 134217728 bytes
4 heads, 63 sectors/track, 1040 cylinders, total 262144 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

 Device Boot      Start         End      Blocks   Id  System
hd.img1   *          63      258047      128992+   6  FAT16
More info here, but we need to know the unit of sectors which is 512 and the start sector of the partition which is 63.
Then we can use loop-mounting to mount the disk and access it.

Code: Select all

sudo losetup /dev/loop0 hd.img -o $((63 * 512))
sudo file -s /dev/loop0
sudo mount /dev/loop0 /mnt
We should now be able to copy files into /mnt to put them on the DOS hard disk. After doing this un-mount it before going back into the emulator.

Code: Select all

sudo umount /mnt
sudo losetup -d /dev/loop0
Hope this helps! Enjoy :)
Dave

User avatar
scruss
Posts: 2418
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: 8086tiny

Tue Jan 28, 2014 3:04 pm

Gradely!

I had fun playing with the 4043 byte (= 8086 nybble; you absolute star, Adrian …) version. Should run Protext no trouble, complete with printer passthrough.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: 8086tiny

Tue Jan 28, 2014 4:26 pm

scruss wrote:Gradely!

I had fun playing with the 4043 byte (= 8086 nybble; you absolute star, Adrian …) version. Should run Protext no trouble, complete with printer passthrough.
Jawdropping awesome. Had to climb down my chair to pick it up.

The rest of the entries to the ioccc contest over the years as well. The really early ones sadly don't compile anymore, but I had a lot of fun playing around with them just a couple of days ago. Someone posted a link to the same entry earlier. I think on another forum.

Beautiful, brilliant people. They do exist.

User avatar
scruss
Posts: 2418
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: 8086tiny

Wed Jan 29, 2014 12:35 am

There's the similarly small CP/M emulator from IOCCC. You have to be kind of old to have any interest in running it, but it's quite functional.

(you can tell I really want to build an N8VEM, but why I'd want to spend more money on slower computer than a Raspberry Pi …)
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

Heater
Posts: 13062
Joined: Tue Jul 17, 2012 3:02 pm

Re: 8086tiny

Wed Jan 29, 2014 10:09 am

scruss,

Your CP/M link does not work.

8086tiny is amazing. Perhaps I should try and get it running on my little STM32 F4 Discovery board.

It's kind of weird to watch a Raspi running that and remember how big, heavy and power hungry the original IBM PC was!

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: 8086tiny

Wed Jan 29, 2014 11:54 am

Folks, this is now in the Raspbian repo. It comes with a ready to use 20 MB hard disk image, already formatted.

Code: Select all

sudo apt-get update
sudo apt-get install 8086tiny
cd /opt/8086tiny
sudo ./runme
There are also a couple of shell scripts that allow you to mount and unmount the DOS hard disk.
To mount

Code: Select all

cd /opt/8086tiny
sudo ./mount
cd /mnt
ls
To unmount

Code: Select all

cd /opt/8086tiny
sudo ./unmount

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4118
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: 8086tiny

Tue Feb 04, 2014 2:33 pm

it's just my personal opinion but I always think that using bare /mnt as the mount point is bad form & can cause problems so I think the scripts to mount/unmount the hd image should use a subdir within /mnt rather than the bare /mnt

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4118
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: 8086tiny

Tue Feb 04, 2014 2:42 pm

scruss wrote:There's the similarly small CP/M emulator from IOCCC. You have to be kind of old to have any interest in running it, but it's quite functional.

(you can tell I really want to build an N8VEM, but why I'd want to spend more money on slower computer than a Raspberry Pi …)
I haven't built N8VEM for the raspberry pi but if you want CP/M then z80pack & YAZE work perfectly on the raspberry pi. they were about the 2nd or 3rd things I ever compiled for the raspberry pi

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: 8086tiny

Tue Feb 04, 2014 2:43 pm

Fair point, I guess I can add this in for a future update :)
/mnt/8086tiny I guess would be better?

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4118
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: 8086tiny

Tue Feb 04, 2014 3:00 pm

Davespice wrote:Fair point, I guess I can add this in for a future update :)
/mnt/8086tiny I guess would be better?
yep, that'd work

Michael_O
Posts: 23
Joined: Sat Oct 20, 2012 12:28 pm

Re: 8086tiny

Tue Feb 04, 2014 5:00 pm

Hi
This is fascinating, I have to look quickly and see did I really throw out my old DOS floppies the other day!
In the meantime I have a copy of AsEasyAs on a Windows share I can access from the Pi but I can't copy it into the mounted virtual disk. I don't know how to change the permissions to allow me to do this. I have tried 'sudo chmod 777 /mnt ' in a console using ssh but it doesn't work. Can you tell me what I should do please?
This is an amazing piece of work and the authors presentation of it to the judges should have won on its own!

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: 8086tiny

Wed Feb 05, 2014 6:22 pm

Nice.
But it looks like the only way to exit is kill -1 [PID].

Great job.
That Dave, what a great smile. Such a nice guy.
Antikythera

andrum99
Posts: 772
Joined: Fri Jul 20, 2012 2:41 pm

Re: 8086tiny

Wed Feb 05, 2014 9:46 pm

solar3000 wrote:Nice.
But it looks like the only way to exit is kill -1 [PID].
That's what I thought, until I read the post above. It seems:

Code: Select all

quitemu
exits the VM. This uses the quitemu.com executable in the default image. This can presumably be copied to any other disk image you might use.

andrum99
Posts: 772
Joined: Fri Jul 20, 2012 2:41 pm

Re: 8086tiny

Thu Feb 06, 2014 5:07 pm

There seems to be a new version of 8086tiny in Raspbian now - I just updated to version 1.10 from 1.03. It seems to have moved out of /opt and I can't find the runme script - does anyone know what's up?

User avatar
RaTTuS
Posts: 10406
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: 8086tiny

Thu Feb 06, 2014 5:16 pm

umm /mnt ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
duberry
Posts: 379
Joined: Mon Jan 28, 2013 10:44 pm
Location: standing on a planet that's evolving. And revolving at nine hundred miles an hour

Re: 8086tiny

Thu Feb 06, 2014 6:15 pm

andrum99 wrote:I can't find the runme script
You could; let the computer find it for you ? using hxxp://en.wikipedia.org/wiki/Find
eg .

Code: Select all

 sudo find / -name runme
lend me your arms, fast as thunderbolts, for a pillow on my journey.
If the environment was a bank, would it be too big to fail
so long; and thanks for all the pi

mob-i-l
Posts: 263
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: 8086tiny

Sat Feb 08, 2014 11:27 am

Maybe 8086tiny could be made to emulate the Amstrad PC1512 (documented at http://www.seasip.info/AmstradXT/1512tech/ ). It had an extended CGA-mode with 16 simultaneous colors. PC1512 was my second computer but I soon replaced the Intel 8086 with a NEC V30 CPU (similar to 80186 but also with 8080-mode) and added 128KB RAM, 30MB HDD, 720KB FDD, and 1200BPS modem.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

mob-i-l
Posts: 263
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: 8086tiny

Sat Feb 08, 2014 1:15 pm

scruss wrote:There's the similarly small CP/M emulator from IOCCC. You have to be kind of old to have any interest in running it, but it's quite functional.
I did find a cashed version of the CP/M-site:
http://webcache.googleusercontent.com/s ... lator.html
and some more info:
http://www.embedded-it.de/en/bsp/demos/ ... ulator.php
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

User avatar
scruss
Posts: 2418
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: 8086tiny

Sat Feb 08, 2014 4:47 pm

mob-i-l wrote:I did find a cached version of the CP/M-site: …
Dunno why you'd need those, as the author's Toledo 8080 processor emulator site still works. Builds and runs fine on Raspberry Pi.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: 8086tiny

Sat Feb 08, 2014 9:24 pm

andrum99 wrote:There seems to be a new version of 8086tiny in Raspbian now - I just updated to version 1.10 from 1.03. It seems to have moved out of /opt and I can't find the runme script - does anyone know what's up?
Okay I need to update everyone on this. I've been getting to grips with the Debian packaging system as I've been going. So I'm sorry for the inconvenience of things moving around. A few people emailed in to complain that I wasn't following the standard packaging procedure so I've been doing my best to bring it in line. Here is a history of what has been going on.
  • 1.03 = cd /opt/8086tiny && sudo ./runme
    Problematic because /opt is not the right place and that sudo was needed to run the emulator (owing to the installed files acquiring root ownership during installation of the package).
  • 1.10 = cd /usr/share/8086tiny && ./runme
    Main emulator binary now installed to /usr/bin
    Everything else installed to /usr/share/8086tiny
    runme shell script copies bios file and disk images to ~/.8086tiny (so the pi user has ownership) and runs the emulator from there (the correct Linux way of doing it)
    Still problematic though because the user needs to cd to /usr/share/8086tiny before using runme
  • 1.11 = 8086tiny-run (from anywhere)
    Done away with the runme shell script but now installs a few extra shell script to /usr/bin which can be run from anywhere. There are;
    8086tiny-run
    8086tiny-mount (mounts to /mnt/8086tiny)
    8086tiny-unmount
    8086tiny-newimage
  • 1.20 = 8086tiny (from anywhere)
    Renamed the 8086tiny binary to 8086tiny.bin and renamed 8086tiny-run to 8086tiny. Users can now just type 8086tiny to run the emulator from anywhere. Disk images still live in ~/.8086tiny.

mob-i-l
Posts: 263
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: 8086tiny

Sat Feb 08, 2014 10:18 pm

scruss wrote:
mob-i-l wrote:I did find a cached version of the CP/M-site: …
Dunno why you'd need those, as the author's Toledo 8080 processor emulator site still works. Builds and runs fine on Raspberry Pi.
That nanochess.org-link hasn't worked anytime when I tried it.

Edit: The site worked now and I got this CP/M-emulator to work. Very cool!
Last edited by mob-i-l on Sun Feb 23, 2014 11:50 pm, edited 1 time in total.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

hene193
Posts: 4
Joined: Mon Nov 18, 2013 2:06 pm

Re: 8086tiny

Sat Feb 08, 2014 10:32 pm

How do I change floppies? I've three floppy images.

andrum99
Posts: 772
Joined: Fri Jul 20, 2012 2:41 pm

Re: 8086tiny

Sat Feb 08, 2014 10:37 pm

Thanks for the update. :-)

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: 8086tiny

Sat Feb 08, 2014 11:42 pm

hene193 wrote:How do I change floppies? I've three floppy images.
Normally the shell scripts run the binary like so: 8086tiny fd.img hd.img, however you can also go 8086tiny myfloppy.img hd.img.
If you're using 1.10 or later check out the ~/.8086tiny folder.

hene193
Posts: 4
Joined: Mon Nov 18, 2013 2:06 pm

Re: 8086tiny

Sun Feb 09, 2014 6:12 am

Davespice wrote:
hene193 wrote:How do I change floppies? I've three floppy images.
Normally the shell scripts run the binary like so: 8086tiny fd.img hd.img, however you can also go 8086tiny myfloppy.img hd.img.
If you're using 1.10 or later check out the ~/.8086tiny folder.
I know that but I'm trying to install MSDOS so I need to change it without relaunching whole program.

Edit: I was just thinking can I give the program physical andress? Then I just could mount those images on fly.

Return to “General discussion”