adriancable / 8086tiny Goto Github PK
View Code? Open in Web Editor NEWOfficial repository for 8086tiny: a tiny PC emulator/virtual machine
Home Page: www.megalith.co.uk/8086tiny
License: MIT License
Official repository for 8086tiny: a tiny PC emulator/virtual machine
Home Page: www.megalith.co.uk/8086tiny
License: MIT License
Not sure but curious since these chips were apparently quite similar: does this also support the 8088?
I just uploaded some spiffing snaps of a modern machine yesterday (feel free to use)...
... the machine in question was donated to the Australian Computer Museum Society.
Look at this block in the bios:
mov ah, 0
cpu 186
shl ax, 9
extended_read_disk
shr ax, 9
cpu 8086
mov ah, 0x02 ; Put read code back
cmp al, 0
je rd_error
The extended_read_disk
instruction writes the error to AL
. But right after the read we shift AX
back 9 bits to right (shr ax, 9
) which overrides AL
. So what's even the point of cmp al, 0
and setting AL
in extended_read_disk
?
And even when you fix the bios, the read function in 8086tiny.c
is still wrong. You use AX
as length to read. But read()
returns, for example 512, which is 0
inside AL
because of the overflow. So even if we don't shift bits after the read AL
indicates "error".
Are there any workarounds for not having timeb.h? https://www.gnu.org/software/gnulib/manual/html_node/sys_002ftimeb_002eh.html
The CAST
macro is used to generate unaligned accesses. This breaks compatibility on architectures which don't support unaligned access, like ARM.
I'm looking into this issue and it seems that I would have to rewrite the CAST macro to be an inline function that uses byte loads.
Post macro-expansion, the code in
Line 391 in c79ca2a
(scratch_int = *(unsigned short *)&mem[rm_addr]) &&
!(scratch2_uint = (unsigned)(scratch_uint = (regs16[i_w + 1] << 16) + regs16[0]) / scratch_int,
scratch2_uint - (unsigned short)scratch2_uint)
? regs16[i_w + 1] = scratch_uint - scratch_int * (*regs16 = scratch2_uint)
The type of scratch_int * (*regs16 = scratch2_uint)
is int
due to the LHS being an int
and the RHS being an unsigned short
. It is promoted to unsigned int
before the subtraction. A counterexample generated by CBMC was -
scratch_int
= 33793, scratch_uint
= 2181038080, scratch2_uint
(division result) = 64541. scratch_int * scratch2_uint
= 2181034013 does not fit inside a 4-byte int
.
Detected using Frama-C (eva) and CBMC while doing a project for the Software Verification and Analysis course under Prof @mksrivas at CMI
have a freelancer working on this port currently.
emcc 8086tiny.c -DNO_GRAPHICS -o 8086tiny.html -fsigned-char -O1 --embed-file bios --embed-file fd.img
node 8086tiny.js bios fd.img
keyboard , sound and graphics not working.
What version the 8086tiny need? i have SDL2
When i run 'make' the output is this:
cc 8086tiny.c sdl-config --cflags --libs
-O3 -fsigned-char -std=c99 -o 8086tiny
/bin/sh: 1: sdl-config: not found
8086tiny.c:18:10: fatal error: SDL.h: No such file or directory
_ 18 | #include "SDL.h"
___ | ^~~~~~~
compilation terminated.
make: *** [Makefile:16: 8086tiny] Error 1
Hello, I'm trying to boot linux ELKS via 8086tiny but the boot stops like this:
ELKS.......................................................................................................................................................... ELKS Setup ....L0831C3AH00S0A t02D0 f0FC6 d12BA Direct console, scan kbd 80x25 emulating ANSI (3 virtual consoles)
At this point it just hangs.
Is there a way to get the boot log or something to figure out what has gone wrong?
Thanks in advance!
I think your LEA implementation is wrong.
When I want to execute, for example, lea sp, ...
the c variable op_from_addr
is 0xf0008
which points inside mem
to ES
instead to SP
. This is because you calculate
op_from_addr = REGS_BASE + i_reg * 2;
for your LEA implementation instead of just
op_from_addr = REGS_BASE + i_reg;
(without * 2
).
Q1: In bios.asm
, how can I save a value (number, string, etc.) such as the content of biosstr
(string) in a memory area of the emulator, and then read and print that memory area from 8086tiny.c
?
Q2: Same question as Q1 but in reverse, storing a variable in 8086tiny.c
, and then reading and printing that value from bios.asm
.
Q3: In FreeDOS kernel, how can I save a value (number, string, etc.) in a memory area of the emulator, and then read and print that memory area from 8086tiny.c
or from bios.asm
?
Q4: Same question as Q3 but in reverse, storing a variable in 8086tiny.c
or bios.asm
, and then reading and printing that value from FreeDOS kernel.
Q5: I have same question: https://8086tiny.freeforums.net/thread/82/starting-exe-files-command-line
Q6: I have same question: https://8086tiny.freeforums.net/thread/62/local-drive-access
regards,
Danny.
Is there a way to interface the com(x) ports under DOS to access USB devices (modem in particular)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.