Arjay 
         02.11.2013, 01:07 (edited by Arjay, 02.11.2013, 02:02)   | 
     Virtual x86 - Javascript x86 emulator with FreeDOS/graphics (Announce) | 
    
    
     As mentioned by dmccunney on the FreeDOS user mailing list the other day, if you've not already seen it there is another good interesting Virtual x86 emulator @ http://copy.sh/v24/  This emulator supports graphics unlike JSLinux doesn't need Java (e.g. unlike JPC).  V86 (V24) currently has 4 different hosted images you can boot (KolibriOS, Linux 2.6, FreeDOS, OpenBSD), you can download images after you've played around with them.  FreeDOS boots very quickly and has a number of applications.  You can also boot your own CD, Floppy or hard drive images!  Cutting and pasting is a simple right click, e.g.  
SeaBIOS (version rel-1.7.3-74-g3061815-dirty-20131005_235927-eevee) 
Booting from Floppy... 
FreeDOS kernel - SVN (build 2040 OEM:0xfd) [compiled Apr 7 2012] 
Kernel compatibility 7.10 - WATCOMC - FAT32 support 
(C) Copyright 1995-2011 Pasquale J. Villani and The FreeDOS Project. 
All Rights Reserved. This is free software and comes with ABSOLUTELY NO 
WARRANTY; you can redistribute it and/or modify it under the terms of the 
GNU General Public License as published by the Free Software Foundation; 
either version 2, or (at your option) any later version. 
- InitDiskno hard disks detected 
Can't disable A20 - ignored 
FreeDOS HIMEM 2.07 [Feb 13 2003] (c) 1995, Till Gerken 2001-2003 tom ehlert 
Interface : XMS 2.00 80386 64MB 
Kernel: allocated 46 Diskbuffers = 24472 Bytes in HMA 
FreeCom version 0.82 pl 3 XMS_Swap [Dec 10 2003 06:49:21] 
Welcome to FreeDOS (http://www.freedos.org)! 
Running on copy.sh/v86/ 
Try 'invaders' or 'snake' or 'tetris' for fun.  
A:\>ver /r 
FreeCom version 0.82 pl 3 XMS_Swap [Dec 10 2003 06:49:21] 
DOS version 7.10 
FreeDOS kernel version 0.0.40 
A:\> 
 
Kyriakos Ktorides provides a good quick overview on of V24 on his website Kyriakos's Den: x86 Emulator in your Browser.  The osdev.org forum discussion may also be of interest. 
 
WATCHOUT: If you use reset or buttons be aware that until you click into the text console again that they will still be highlighted, e.g. if you last hit reset then unless you click into the console when you start typing it will reboot again as reset will still be highlighted :)  Still testing.... 
 
For anyone new to the BTTR forum, you may find the past JSLinux / Runcom discussion also interesting. 
 
On a semi-related note Rod Pemberton's list of BIOS calls used by various OSes, bootloaders, etc., online references was an interesting reminder for me of some references I've referred to myself in the past.  I'm mentioning it as I thought it was a good starting point for anyone interested in low level who may not be aware of some of the references he refers to.  | 
    
               
             Arjay 
         02.11.2013, 01:43         (edited by Arjay, 02.11.2013, 02:02)                
  @ Arjay
         | 
     Virtual x86 - Javascript x86 emulator with FreeDOS/graphics | 
    
    
     A quick guide for anyone interested in doing a quick test with a modified image: 
 
1) Boot V86 (V24) into the provided FreeDOS image, then click "Get modified floppy image" to download the 5.25" 720KB floppy image.  The file will be floppy.img 
2) Make a copy, e.g. floppy2.img 
3) Install Ken Kato's Virtual Floppy Driver (see below) 
4) Open the image in VFD as a file 
5) Browse to the drive with explorer, e.g. A:\ 
6) Modify/delete/add as required 
7) Click [Save] in VFD 
8) Open the saved image in VFD by clicking returning to the main page then browsing to your image. 
 
Installing VFD 
 
Fairly straight forward 
1) Download unzip where required 
2) Browse to the unzipped folder 
3) Right click onto VFD.EXE and select "RunAs Administrator", type "install" as below: 
Virtual Floppy Drive for Windows 2.1.2008.0206 
Copyright (c) 2003-2008 Ken Kato 
http://chitchat.at.infoseek.co.jp/vmware/vfd.html/]http://vfd.sourceforge.net/#download 
 
    ********** the VFD interactive console ********** 
 
you can use the following commands in addition to regular VFD commands: 
 
    ATTRIB  CD      CHDIR   <drive>: 
    DIR     EXIT    QUIT    BYE 
    .(period) + Windows command 
 
Type '? CONSOLE' or 'HELP CONSOLE' for more information 
 
[VFD] install 
Installed the Virtual Floppy driver. 
 
[VFD]EXIT 
 
If when you type install you get this instead... 
 
Failed to start the VFD driver. 
Access is denied. 
 
... then your not running VFD.EXE as adminstrator ;) 
 
4) Right click onto VFDWIN.EXE then select "RunAs Administrator" 
5) On the driver tab ensure the VFD.SYS has been selected, if not browse to it and select it. 
6) Click start 
7) Change to the Drive 0 tab, browse to your image 
8) Continue as above. 
 
 
You can then download your re-download your "modified" images by clicking "Get modified floppy image" which obviously can then be opened in VFD.  I have just used the above method to load to get V86's IVT under FreeDOS as a test.  | 
     
                
             Arjay 
         02.11.2013, 06:40         (edited by Arjay, 02.11.2013, 14:46)                
  @ Arjay
         | 
     Fake86js = Javascript port of Mike Chamber's Fake86+DOS | 
    
    
     Wow, we are getting spoilt for choice now. Fake86js (source on github) = Java Script port of Mike Chamber's Fake86 booting DOS with graphics support.  Worked for me under Opera very slowly but failed under FireFox - even though the authors site says the opposite.  Latest versions of both browsers. 
 
See also: James Friend's PCE.js + PCjs Simulator by @jeffpar  
 
(via http://forums.aria.co.uk/showthread.php/130049-x86-emulator-written-in-JavaScript)  | 
     
                
             Arjay 
         02.11.2013, 08:04         (edited by Arjay, 02.11.2013, 14:41)                
  @ Arjay
         | 
     Virtual x86 - Javascript x86 emulator with FreeDOS+HXDOS | 
    
    
     I created a 2.88 floppy with VFD, installed HXDOS... attempting to run anything HXDOS related = "Unimplemented: #NP handler Execution stopped" from V86 - I thought I would give it a try. 
 
Looked at it after some sleep.  Noted the following when booting via copy.sh: 
 
- InitDiskno hard disks detected                                                
Can't disable A20 - ignored 
FreeDOS HIMEM 2.07 [Feb 13 2003] (c) 1995, Till Gerken 2001-2003 tom ehlert      
Interface : XMS 2.00 80386 64MB 
 
Same image "booted" via DosBOX (boot freedos722.img): 
 
- InitDiskno hard disks detected                                                
FreeDOS HIMEM 2.07 [Feb 13 2003] (c) 1995, Till Gerken 2001-2003 tom ehlert      
Interface : XMS 2.00 80386 64MB 
 
So the A20 line isn't supported which is the same thing mentioned by marcov New Xeon's no A20 with a mention that FreeDOS's HIMEM now works around this.  Japheth, is this something HXDOS could also work around in this type of situation?  Might be helpful with other emulators, the new boards coming out.  | 
     
                
             Arjay 
         07.11.2013, 00:06                        
  @ Arjay
         | 
     Virtual x86 - Javascript x86 emulator - source released! | 
    
    
     Copy has done a few updates to V86 and also now released the source: 
http://copy.sh/v24/ (see site for tarball) 
http://github.com/copy/v86  | 
     
                
             RayeR 
        
  
  CZ,  07.11.2013, 14:53                        
  @ Arjay
         | 
     Virtual x86 - Javascript x86 emulator - source released! | 
    
    
     > Copy has done a few updates to V86 and also now released the source: 
> http://copy.sh/v24/ (see site for 
> tarball) 
> http://github.com/copy/v86 
 
does it also support pmode? I tried to run some DJGPP program, CWSDPMI can be preloaded but then I always get 
Unimplemented: load system segment descriptor, type = 9 
Execution stopped --- DOS gives me freedom to unlimited HW access.  | 
     
                
             Arjay 
         07.11.2013, 17:19         (edited by Arjay, 07.11.2013, 17:38)                
  @ RayeR
         | 
     Virtual x86 - Javascript x86 emulator - source released! | 
    
    
     > does it also support pmode? I tried to run some DJGPP program, CWSDPMI can 
> be preloaded but then I always get 
> Unimplemented: load system segment descriptor, type = 9 
> Execution stopped 
 
I have swapped a few emails with copy and my understanding is he still needs to implement some of the 16bit features required by DOS extenders.  He's kindly added support for smaller disk formats, e.g. 160k.  However I've noted myself that SeaBIOS fails to boot some disks that lack the 55AAh signature as was common in the days of the XT.  It would be good if SeaBIOS had a new setting to ignore bootsector signature checking as it was only implemented in the AT. 
 
[EDIT]Looks like such a feature exists in SeaBIOS and appears to be called "no-fd-bootchk" - discussion here: http://lists.gnu.org/archive/html/qemu-devel/2013-07/msg01193.html 
 
However not much in the way in terms of documentation that I can see beyond that discussion.  http://www.seabios.org/ simply refers to http://www.coreboot.org/SeaBIOS for documentation.  I note that under http://www.coreboot.org/SeaBIOS#Adding_a_floppy_image it says the following: 
"Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.[/EDIT]  | 
     
                
             Arjay 
         07.11.2013, 22:49                        
  @ Arjay
         | 
     Virtual x86 - Javascript x86 emu   no-fd-bootchk now enabled | 
    
    
     copy has also kindly now enabled the "no-fd-bootchk" feature.  I have very quickly tested with a few disks (busy with other things) but any testing is obviously appreciated.   
 
With bug reports via http://github.com/copy/v86/issues  | 
     
                
             Rugxulo 
        
  
  Usono,  29.12.2013, 04:35                        
  @ Arjay
         | 
     Shelta v1.2 online in FreeDOS in v86 | 
    
    
     http://catseye.tc/node/Shelta_v1.2_online_in_FreeDOS_in_v86 (December 12,2013) 
 
"Version 1.2 of the Shelta distribution has been released. This is a very minor update, with the only change to the language being essentially inconsequential: Shelta source files now must end with everybody's favourite character, the vertical tab, instead of a null byte. 
 
This was to work around what seems to be a subtle bug in FreeDOS. And that, in turn, was to get Shelta running under FreeDOS inside the HTML5-based IBM PC compatible emulator, v86. You can read all the gory details here. 
 
Anyway, this all brings us to the good news, which is: you can now play with Shelta ? including bootstrapping it ? online, right here!"  | 
     
                
             Rugxulo 
        
  
  Usono,  10.01.2014, 00:18                        
  @ Rugxulo
         | 
     22nd IOCCC winners | 
    
    
     (Okay, so this isn't related to V86 nor Javascript, just emulation in general.) 
 
2013-11-16 
The winners of the 22nd IOCCC have been announced. Congratulations! 
 
2014-01-03 
The source code for the winners of the 22nd IOCCC has been released. 
 
Largest small system emulator: A tiny but highly functional PC emulator/virtual machine 
 
"a portable PC emulator/VM written specifically for the IOCCC which runs DOS, Windows 3.0, Excel, MS Flight Simulator, AutoCAD, Lotus 1-2-3 ?" 
 
http://ioccc.org/2013/cable3/hint.html 
 
https://news.ycombinator.com/item?id=7012385  | 
     
                
             RayeR 
        
  
  CZ,  12.01.2014, 02:30                        
  @ Rugxulo
         | 
     22nd IOCCC winners | 
    
    
     Cool for that size. 
I tried to compile under Mingw32, it did with some warnings but it hanged at startup, no error on screen, no SDL window created (I use ver 1.2.15). 
The source, ehm, is too obfuscated :P I don't know if I look on C code or Brainfuck :) Maybe it would be better to look on code in disassembler (well after "CPP CABLE3.C" it's slightly better :) --- DOS gives me freedom to unlimited HW access.  | 
     
                
             Rugxulo 
        
  
  Usono,  24.01.2014, 13:58                        
  @ RayeR
         | 
     22nd IOCCC winners | 
    
    
     > Cool for that size. 
> I tried to compile under Mingw32, it did with some warnings but it hanged 
> at startup, no error on screen, no SDL window created (I use ver 1.2.15). 
> The source, ehm, is too obfuscated :P I don't know if I look on C code or 
> Brainfuck :) Maybe it would be better to look on code in disassembler (well 
> after "CPP CABLE3.C" it's slightly better :) 
 
I just stumbled upon this at FASM's forum: 
 
http://www.megalith.co.uk/8086tiny/ 
 
" 
8086tiny is highly portable, with minimal system requirements: 
 
* Minimal C runtime library support required (uses POSIX file I/O and time functions only - no memory management or string functions) 
* Uses SDL 1.2 for graphics, but can compile without SDL for text-only applications 
* Storage requirement: typically around 20KB for compiled binary, 9KB for BIOS image, and 720KB/1.44MB for floppy disk image 
* System RAM requirement: around 1.5MB 
 
Complete source code provided (including custom BIOS) 
 
An obfuscated version of 8086tiny (condensed into just 4043 bytes of C code) was a winner of the 2013 IOCCC contest. Significant interest followed for a documented, commented, maintainable version. The result is the distribution presented here. 
 
8086tiny is free to use for any purpose, commercial or non-commercial, and is made available under the MIT License. 
 
Release History 
* 1.02 (January 24th, 2014): Source code tidy-up to remove compiler warnings. 
* 1.01 (January 23rd, 2014): License changed to MIT License. Minor source revisions. 
* 1.00 (January 21st, 2014): Initial release. 
 
Any questions, comments or suggestions are very welcome in our forum. 
"  | 
     
                
             RayeR 
        
  
  CZ,  25.01.2014, 01:28                        
  @ Rugxulo
         | 
     22nd IOCCC winners | 
    
    
     > I just stumbled upon this at 
> FASM's forum: 
> http://www.megalith.co.uk/8086tiny/ 
 
Thanks for info. I downloaded and tried it to compile. Under Mingw it compiles without warnings but doesn't work - same as before, no SDL window created and rotten thread left running in system. Well so I edit Makefile to disable SDL, then it booted FreeDOS in text mode but I'm getting some garbage in console output - maybe some Linux terminal controls? Those guys probably never tried to compile it outside Linux :\ I also tried to compile it under DJGPP with 2 warnings but it doesn't work, just hanged waiting for ctrl+break :( Do you or someone else to make it work? 
 
 
 type HELP to get support on commands and navigation 
 
A:\>←[?25hver 
←[?25h 
FreeCom version 0.82 pl 3 XMS_Swap [Dec 10 2003 06:49:21] 
 
A:\>←[?25hdir 
←[?25h Volume in drive A is FREEDOS1 
 Volume Serial Number is 4559-120D 
 Directory of A:\ 
 
←[0mEL   SYS        45,450  04-07-2012  8:13a 
←[0mAND  COM        66,090  12-10-2003  7:49a 
←[0mIG   SYS           721  01-19-2014  2:05a 
←[0mEXEC BAT           894  01-19-2014  2:04a 
←[0mDOS              <DIR>  10-07-2006 10:56a 
←[0mNFO  TGZ        11,021  10-11-2006  3:00p 
←[0mEMU  COM             5  06-19-2013  4:35p 
←[0m     6 file(s)        124,181 bytes 
←[0m     1 dir(s)          17,408 bytes free 
←[0m 
A:\>←[?25h 
 
 
EDIT: the ← was displayed as left arrow symbol <- --- DOS gives me freedom to unlimited HW access.  | 
     
                
             RayeR 
        
  
  CZ,  25.01.2014, 15:30                        
  @ RayeR
         | 
     22nd IOCCC winners | 
    
    
     I looked into the source and found a place where it probably do all outputs on textmode screen (line 650): 
 
NEXT_OPCODE_SUBFUNCTION // PUTCHAR_AL 
	write(1, regs8, 1) 
 
There's no any putchar, putc, pritnf, frprint in the code. According to libC reference write() is common function to write in file, args are: int file descriptor, void pointer to data, lenght). The question is where they sucked out of thumb the file descriptor value 1. There's no open() call to get the file no. So it would be probably some standard file like STDOUT but for some reason it doesn't work in DJGPP. Maybe there's a different constant or I need call open() first...? 
Here's nothing about magic constants http://www.delorie.com/djgpp/doc/libc/libc_866.html --- DOS gives me freedom to unlimited HW access.  | 
     
                
             RayeR 
        
  
  CZ,  25.01.2014, 18:00                        
  @ RayeR
         | 
     22nd IOCCC winners | 
    
    
     write(1, regs8, 1) 
 
Well, this is not the issue, it works also under DOS/DJGPP (more clean is to use fileno(stdout)) problem is somewhere else, I give up DOS. 
I slightly modified linker options to make Win32 version with working console output + SDL. Now I know, that SDL window opens only for Hercules emulation if some HGA program is launched. Otherwise it outputs in textmode to console (there was problem with main vs winmain so I didn't get console before). I tried to run some games that supports HGA but only few works and with bad timing/no sync. So its a toy, nothing really usefull... 
 
Apollo 18: 
![[image]](http://rayer.g6.cz/1tmp/apollo.png)  
 
No Exit 
![[image]](http://rayer.g6.cz/1tmp/noexit.png)  --- DOS gives me freedom to unlimited HW access.  | 
     
                
             roytam 
         26.01.2014, 14:53         (edited by Rugxulo, 27.01.2014, 23:15)                
  @ RayeR
         | 
     22nd IOCCC winners | 
    
    
     > write(1, regs8, 1) 
>  
> Well, this is not the issue, it works also under DOS/DJGPP (more clean is 
> to use fileno(stdout)) problem is somewhere else, I give up DOS. 
> I slightly modified linker options to make Win32 version with working 
> console output + SDL. Now I know, that SDL window opens only for Hercules 
> emulation if some HGA program is launched. Otherwise it outputs in textmode 
> to console (there was problem with main vs winmain so I didn't get console 
> before). I tried to run some games that supports HGA but only few works and 
> with bad timing/no sync. So its a toy, nothing really usefull... 
>  
> Apollo 18: 
> http://rayer.g6.cz/1tmp/apollo.png 
>  
> No Exit 
> http://rayer.g6.cz/1tmp/noexit.png 
 
please get ansicon installed to get rip of escape sequences ;) 
http://adoxa.hostmyway.net/ansicon/  | 
     
                
             RayeR 
        
  
  CZ,  26.01.2014, 16:37                        
  @ roytam
         | 
     22nd IOCCC winners | 
    
    
     Thx, I tried load ansi.sys but it didn't work. Ansicon works. --- DOS gives me freedom to unlimited HW access.  | 
     
                
             roytam 
         27.01.2014, 00:06                        
  @ roytam
         | 
     22nd IOCCC winners | 
    
    
     > > write(1, regs8, 1) 
> >  
> > Well, this is not the issue, it works also under DOS/DJGPP (more clean 
> is 
> > to use fileno(stdout)) problem is somewhere else, I give up DOS. 
> > I slightly modified linker options to make Win32 version with working 
> > console output + SDL. Now I know, that SDL window opens only for 
> Hercules 
> > emulation if some HGA program is launched. Otherwise it outputs in 
> textmode 
> > to console (there was problem with main vs winmain so I didn't get 
> console 
> > before). I tried to run some games that supports HGA but only few works 
> and 
> > with bad timing/no sync. So its a toy, nothing really usefull... 
> >  
> please get ansicon installed to get rip of escape sequences ;) 
> http://adoxa.hostmyway.net/ansicon/ 
 
BTW 1.03 is released. ;) 
1.03 (January 26th, 2014): Hercules CRTC resolution reprogramming now supported, needed by some applications e.g. ETEN Chinese System.  | 
     
                
             Rugxulo 
        
  
  Usono,  27.01.2014, 23:24                        
  @ RayeR
         | 
     22nd IOCCC winners | 
    
    
     > Thanks for info. I downloaded and tried it to compile. Under Mingw it 
> compiles without warnings but doesn't work - same as before, no SDL window 
> created and rotten thread left running in system. Well so I edit Makefile 
> to disable SDL, then it booted FreeDOS in text mode but I'm getting some 
> garbage in console output - maybe some Linux terminal controls? Those guys 
> probably never tried to compile it outside Linux :\ 
 
According to their forum, "it's because the FreeDOS [but not MS-DOS!] console outputs ANSI codes formatting, which the default Windows terminal does not support." And yes, ANSICON seems like the best solution to that. (I haven't tested any of this recently, hence my slow reply to what is probably obvious by now.)  | 
     
                
             roytam 
         28.01.2014, 04:00                        
  @ Rugxulo
         | 
     22nd IOCCC winners | 
    
    
     > > Thanks for info. I downloaded and tried it to compile. Under Mingw it 
> > compiles without warnings but doesn't work - same as before, no SDL 
> window 
> > created and rotten thread left running in system. Well so I edit 
> Makefile 
> > to disable SDL, then it booted FreeDOS in text mode but I'm getting some 
> > garbage in console output - maybe some Linux terminal controls? Those 
> guys 
> > probably never tried to compile it outside Linux :\ 
>  
> According to their 
> forum, 
> "it's because the FreeDOS [but not MS-DOS!] console outputs ANSI codes 
> formatting, which the default Windows terminal does not support." And yes, 
> ANSICON seems like the best 
> solution to that. (I haven't tested any of this recently, hence my slow 
> reply to what is probably obvious by now.) 
 
It converts DOS text mode colors and cursor placements to ANSI escape sequences in BIOS. 
BTW I build my own SDL-enabled post 1.03 build. 
http://roy.orz.hm/soft/8086tiny-20140128-win32.7z  | 
     
                
             RayeR 
        
  
  CZ,  29.01.2014, 04:43                        
  @ roytam
         | 
     22nd IOCCC winners | 
    
    
     > It converts DOS text mode colors and cursor placements to ANSI escape 
> sequences in BIOS. 
> BTW I build my own SDL-enabled post 1.03 build. 
> http://roy.orz.hm/soft/8086tiny-20140128-win32.7z 
 
I tried it with ancicon but when running Micro Manager it flickers by moving one line up and down about 2x/sec. Also Fx keys didn't work... --- DOS gives me freedom to unlimited HW access.  | 
     
                
             roytam 
         29.01.2014, 23:42                        
  @ RayeR
         | 
     22nd IOCCC winners | 
    
    
     > > It converts DOS text mode colors and cursor placements to ANSI escape 
> > sequences in BIOS. 
> > BTW I build my own SDL-enabled post 1.03 build. 
> > http://roy.orz.hm/soft/8086tiny-20140128-win32.7z 
>  
> I tried it with ancicon but when running Micro Manager it flickers by 
> moving one line up and down about 2x/sec. Also Fx keys didn't work... 
Alt key by using Ctrl+A,{key} and F* key by Ctrl+F,{num} 
for flickering, you have to adjust window 1 line taller.  | 
     
                
             Rugxulo 
        
  
  Usono,  23.02.2014, 01:01                        
  @ roytam
         | 
     22nd IOCCC winners | 
    
    
     > BTW 1.03 is released. ;) 
> 1.03 (January 26th, 2014): Hercules CRTC resolution reprogramming now 
> supported, needed by some applications e.g. ETEN Chinese System. 
 
January 30th, 2014: GitHub repository for 8086tiny is now online. See Download page. 
 
February 3rd, 2014: Revision 1.10. Support for running ELKS/Linux. Hard disk boot support. Fixed disk and video bugs in BIOS. CRT hardware cursor support added. Direct video memory access speed improvements. Improved Makefile for compiling without SDL. 
 
February 5th, 2014: Revision 1.11. Binary and BIOS are smaller and faster. Keystroke dropping and character output bugs fixed. 
 
February 9th, 2014: Revision 1.15. Full keyboard support for graphics (SDL) applications. Performance improvements. 
 
February 20th, 2014: Revision 1.20. Major update. 2X faster CPU, 4X faster graphics. PC speaker, CGA graphics and timer support. Keyboard and video bug fixes.  |