Browse files

Revision 1.25.bios update

A small bios code enhancement allows using small disk images with
common vintage cylinder/head/sector dimensions, where H/S=4/17, and
those are guessed from the hd image size.
  • Loading branch information...
retrohun committed Dec 1, 2018
1 parent c79ca2a commit 20c3a450d5b2467aca47c56e54011713ff4e6ee0
Showing with 43 additions and 21 deletions.
  1. +3 −0 .gitignore
  2. +7 −0
  3. BIN bios
  4. +33 −21 bios_source/bios.asm
  5. BIN docs/images/QNX2_8086tiny.png
@@ -0,0 +1,3 @@
@@ -1,10 +1,17 @@
![QNX 2.15C in action](docs/images/QNX2_8086tiny.png)
8086tiny is a completely free (MIT License) open source PC XT-compatible emulator/virtual machine written in C. It is, we believe, the smallest of its kind (the fully-commented source is under 25K). Despite its size, 8086tiny provides a highly accurate 8086 CPU emulation, together with support for PC peripherals including XT-style keyboard, floppy/hard disk, clock, audio, and Hercules/CGA graphics. 8086tiny is powerful enough to run software like AutoCAD, Windows 3.0, and legacy PC games: the 8086tiny distribution includes Alley Cat, the author's favorite PC game of all time.
8086tiny is highly portable and runs on practically any little endian machine, from simple 32-bit MCUs upwards. 8086tiny has successfully been deployed on 32-bit/64-bit Intel machines (Windows, Mac OS X and Linux), Nexus 4/ARM (Android), iPad 3 and iPhone 5S (iOS), and Raspberry Pi (Linux).
The philosophy of 8086tiny is to keep the code base as small as possible, and through the open source license encourage individual developers to tune and extend it as per their specific requirements, adding support, for example, for more complex instruction sets (e.g. Pentium) or peripherals (e.g. mouse). Forking this repository is highly encouraged!
Any questions, comments or suggestions are very welcome in our forum at
BIOS modifications
QNX 2 harddisk images with 306x4x17 geometry are floating around. With the bios enhancement (that checks for small sized disk images that might be cyls./4/17) can be booted fine.
BIN +48.3 KB (740%) bios
Binary file not shown.
@@ -131,29 +131,16 @@ bios_entry:
; Total number of sectors is in CX:AX, or 0 if there is no HD image. First,
; we put it in DX:CX.
mov [cs:hd_secs_hi], cx
mov [cs:hd_secs_lo], ax
mov dx, cx
mov cx, ax
mov [cs:hd_secs_hi], dx
mov [cs:hd_secs_lo], cx
cmp cx, 0
je maybe_no_hd
mov word [cs:num_disks], 2
jmp calc_hd
cmp dx, 0
je no_hd
mov word [cs:num_disks], 2
jmp calc_hd
mov word [cs:num_disks], 1
or ax, dx
jz calc_hd
mov word [cs:num_disks], 2
@@ -164,11 +151,33 @@ calc_hd:
cmp dx, 0 ; More than 63 total sectors? If so, we have more than 1 track.
ja sect_overflow
cmp ax, 63
ja sect_overflow
ja sect_oldhdd
mov [cs:hd_max_sector], ax
jmp calc_heads
mov cx, 68 ; testing of possible HEAD*SPT divisor of total number of sectors
div cx
or dx, dx ; test if the remainder is zero
jnz not_old
test ax, 0x3C00
jz oldhdd_true
mov dx, [cs:hd_secs_hi]
mov cx, [cs:hd_secs_lo]
jmp sect_overflow
mov [cs:hd_max_track], ax
mov word [cs:hd_max_head], 4
mov word [cs:hd_max_sector], 17
jmp calc_end
mov cx, 63 ; Calculate number of tracks
@@ -3848,4 +3857,7 @@ tm_year equ $+20
tm_wday equ $+24
tm_yday equ $+28
tm_dst equ $+32
tm_msec equ $+36
tm_msec equ $+36
times 5f00h-$+main db 0 ; ROM BASIC loads at offset 0x6000
incbin "ibm-basic-1.10.rom"
Binary file not shown.

0 comments on commit 20c3a45

Please sign in to comment.