├── README.TXT ├── README.md ├── build-linux.sh ├── build-openbsd.sh ├── build-osx.sh ├── buildwin.bat ├── disk_images ├── README.TXT ├── mikeos.dmg ├── mikeos.flp └── mikeos.iso ├── doc ├── CHANGES.TXT ├── CREDITS.TXT ├── LICENSE.TXT ├── handbook-appdev-asm.html ├── handbook-appdev-basic.html ├── handbook-sysdev.html └── handbook-user.html ├── programs ├── advnture.bas ├── archive.bas ├── calc.bas ├── cf.bas ├── draw.bas ├── edit.asm ├── edit.bin ├── example.bas ├── fileman.asm ├── fileman.bin ├── fisher.asm ├── fisher.bin ├── forth.asm ├── forth.bin ├── hangman.asm ├── hangman.bin ├── keyboard.asm ├── keyboard.bin ├── mbpp.bas ├── memedit.bas ├── mikedev.inc ├── monitor.asm ├── monitor.bin ├── muncher.bas ├── sample.pcx ├── serial.asm ├── serial.bin ├── sudoku.bas ├── viewer.asm └── viewer.bin ├── source ├── bootload │ ├── bootload.asm │ └── bootload.bin ├── features │ ├── basic.asm │ ├── cli.asm │ ├── disk.asm │ ├── keyboard.asm │ ├── math.asm │ ├── misc.asm │ ├── ports.asm │ ├── screen.asm │ ├── sound.asm │ └── string.asm ├── kernel.asm └── kernel.bin └── test-linux.sh /README.TXT: -------------------------------------------------------------------------------- 1 | ================================================================== 2 | MikeOS -- Open source 16-bit operating system for x86 PCs 3 | Copyright (C) 2006 - 2014 MikeOS Developers -- see doc/LICENSE.TXT 4 | ================================================================== 5 | 6 | 7 | MikeOS is a 16-bit real mode operating system for x86-compatible PCs, 8 | written entirely in assembly language, which boots from a floppy disk, 9 | CD-ROM or USB key. It features a text-based dialog-driven user 10 | interface, a command-line, support for FAT12 (MS-DOS-like) floppy 11 | disks, sound (PC speaker), text editor, BASIC interpreter and more. 12 | The kernel includes over 60 system calls. 13 | 14 | MikeOS is a learning tool for those wishing to understand simple OS 15 | construction and x86 assembly. Quick getting-started guide: MikeOS can 16 | run from a floppy disk or CD-ROM, either on an emulator or a real PC. 17 | See the disk_images/ directory for files that you can write to the 18 | appropriate media or boot in, for instance, VMware, QEMU or VirtualBox. 19 | 20 | You can find the source code in the source/ directory, and sample 21 | programs (included on the disk images) in the programs/ directory. 22 | See the doc/ directory for more info, including: 23 | 24 | # handbook-user.html -- How to run and use MikeOS 25 | 26 | # handbook-appdev-basic.html -- Writing software in BASIC 27 | # handbook-appdev-asm.html -- Writing software in assembly 28 | # handbook-sysdev.html -- Building and modifying the OS 29 | 30 | # LICENSE.TXT -- The open source, BSD-like license 31 | # CHANGES.TXT -- Detailed list of changes in previous releases 32 | # CREDITS.TXT -- People involved in the project 33 | 34 | Have fun, and see the website at http://mikeos.sourceforge.net 35 | 36 | -- Mike Saunders (okachi@gmail.com) 37 | 38 | 39 | ================================================================== 40 | 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MikeOS 2 | ====== 3 | 4 | Open source 16-bit operating system for x86 PCs 5 | ----------------------------------------------- 6 | 7 | ``` 8 | Copyright (C) 2006 - 2014 MikeOS Developers -- see doc/LICENSE.TXT 9 | ``` 10 | 11 | MikeOS is a 16-bit real mode operating system for x86-compatible PCs, 12 | written entirely in assembly language, which boots from a floppy disk, 13 | CD-ROM or USB key. It features a text-based dialog-driven user 14 | interface, a command-line, support for FAT12 (MS-DOS-like) floppy 15 | disks, sound (PC speaker), text editor, BASIC interpreter and more. 16 | The kernel includes over 60 system calls. 17 | 18 | MikeOS is a learning tool for those wishing to understand simple OS 19 | construction and x86 assembly. Quick getting-started guide: MikeOS can 20 | run from a floppy disk or CD-ROM, either on an emulator or a real PC. 21 | See the disk_images/ directory for files that you can write to the 22 | appropriate media or boot in, for instance, VMware, QEMU or VirtualBox. 23 | 24 | You can find the source code in the source/ directory, and sample 25 | programs (included on the disk images) in the programs/ directory. 26 | See the doc/ directory for more info, including: 27 | 28 | - [handbook-user.html](doc/handbook-user.html) -- How to run and use MikeOS 29 | 30 | - [handbook-appdev-basic.html](doc/handbook-appdev-basic.html) -- Writing software in BASIC 31 | - [handbook-appdev-asm.html](doc/handbook-appdev-asm.html) -- Writing software in assembly 32 | - [handbook-sysdev.html](doc/handbook-sysdev.html) -- Building and modifying the OS 33 | 34 | - [LICENSE.TXT](doc/LICENSE.TXT) -- The open source, BSD-like license 35 | - [CHANGES.TXT](doc/CHANGES.TXT) -- Detailed list of changes in previous releases 36 | - [CREDITS.TXT](doc/CREDITS.TXT) -- People involved in the project 37 | 38 | Have fun, and see the [website](http://mikeos.sourceforge.net) 39 | 40 | [Mike Saunders](mailto:okachi@gmail.com) 41 | 42 | -------------------------------------------------------------------------------- /build-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script assembles the MikeOS bootloader, kernel and programs 4 | # with NASM, and then creates floppy and CD images (on Linux) 5 | 6 | # Only the root user can mount the floppy disk image as a virtual 7 | # drive (loopback mounting), in order to copy across the files 8 | 9 | # (If you need to blank the floppy image: 'mkdosfs disk_images/mikeos.flp') 10 | 11 | 12 | if test "`whoami`" != "root" ; then 13 | echo "You must be logged in as root to build (for loopback mounting)" 14 | echo "Enter 'su' or 'sudo bash' to switch to root" 15 | exit 16 | fi 17 | 18 | 19 | if [ ! -e disk_images/mikeos.flp ] 20 | then 21 | echo ">>> Creating new MikeOS floppy image..." 22 | mkdosfs -C disk_images/mikeos.flp 1440 || exit 23 | fi 24 | 25 | 26 | echo ">>> Assembling bootloader..." 27 | 28 | nasm -O0 -w+orphan-labels -f bin -o source/bootload/bootload.bin source/bootload/bootload.asm || exit 29 | 30 | 31 | echo ">>> Assembling MikeOS kernel..." 32 | 33 | cd source 34 | nasm -O0 -w+orphan-labels -f bin -o kernel.bin kernel.asm || exit 35 | cd .. 36 | 37 | 38 | echo ">>> Assembling programs..." 39 | 40 | cd programs 41 | 42 | for i in *.asm 43 | do 44 | nasm -O0 -w+orphan-labels -f bin $i -o `basename $i .asm`.bin || exit 45 | done 46 | 47 | cd .. 48 | 49 | 50 | echo ">>> Adding bootloader to floppy image..." 51 | 52 | dd status=noxfer conv=notrunc if=source/bootload/bootload.bin of=disk_images/mikeos.flp || exit 53 | 54 | 55 | echo ">>> Copying MikeOS kernel and programs..." 56 | 57 | rm -rf tmp-loop 58 | 59 | mkdir tmp-loop && mount -o loop -t vfat disk_images/mikeos.flp tmp-loop && cp source/kernel.bin tmp-loop/ 60 | 61 | cp programs/*.bin programs/*.bas programs/sample.pcx tmp-loop 62 | 63 | sleep 0.2 64 | 65 | echo ">>> Unmounting loopback floppy..." 66 | 67 | umount tmp-loop || exit 68 | 69 | rm -rf tmp-loop 70 | 71 | 72 | echo ">>> Creating CD-ROM ISO image..." 73 | 74 | rm -f disk_images/mikeos.iso 75 | mkisofs -quiet -V 'MIKEOS' -input-charset iso8859-1 -o disk_images/mikeos.iso -b mikeos.flp disk_images/ || exit 76 | 77 | echo '>>> Done!' 78 | 79 | -------------------------------------------------------------------------------- /build-openbsd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script assembles the MikeOS bootloader, kernel and programs 4 | # with NASM, and then creates floppy and CD images (on OpenBSD) 5 | 6 | # Only the root user can mount the floppy disk image as a virtual 7 | # drive (loopback mounting), in order to copy across the files 8 | 9 | 10 | echo "Experimental OpenBSD build script..." 11 | 12 | 13 | if test "`whoami`" != "root" ; then 14 | echo "You must be logged in as root to build (for loopback mounting)" 15 | echo "Enter 'su' to switch to root" 16 | exit 17 | fi 18 | 19 | 20 | if [ ! -e disk_images/mikeos.flp ] 21 | then 22 | echo ">>> Creating new MikeOS floppy image..." 23 | dd if=/dev/zero of=disk_images/mikeos.flp bs=512 count=2880 || exit 24 | vnconfig vnd3 disk_images/mikeos.flp && newfs_msdos -f 1440 vnd3c && vnconfig -u vnd3 || exit 25 | fi 26 | 27 | 28 | echo ">>> Assembling bootloader..." 29 | 30 | nasm -O0 -w+orphan-labels -f bin -o source/bootload/bootload.bin source/bootload/bootload.asm || exit 31 | 32 | 33 | echo ">>> Assembling MikeOS kernel..." 34 | 35 | cd source 36 | nasm -O0 -w+orphan-labels -f bin -o kernel.bin kernel.asm || exit 37 | cd .. 38 | 39 | 40 | echo ">>> Assembling programs..." 41 | 42 | cd programs 43 | 44 | for i in *.asm 45 | do 46 | nasm -O0 -w+orphan-labels -f bin $i -o `basename $i .asm`.bin || exit 47 | done 48 | 49 | cd .. 50 | 51 | 52 | echo ">>> Adding bootloader to floppy image..." 53 | 54 | dd conv=notrunc if=source/bootload/bootload.bin of=disk_images/mikeos.flp || exit 55 | 56 | 57 | echo ">>> Copying MikeOS kernel and programs..." 58 | 59 | rm -rf tmp-loop 60 | vnconfig vnd3 disk_images/mikeos.flp || exit 61 | 62 | mkdir tmp-loop && mount -t msdos /dev/vnd3c tmp-loop && cp source/kernel.bin tmp-loop/ 63 | 64 | cp programs/*.bin programs/*.bas programs/sample.pcx tmp-loop 65 | 66 | echo ">>> Unmounting loopback floppy..." 67 | 68 | umount tmp-loop || exit 69 | 70 | vnconfig -u vnd3 || exit 71 | rm -rf tmp-loop 72 | 73 | 74 | echo ">>> Creating CD-ROM ISO image..." 75 | 76 | rm -f disk_images/mikeos.iso 77 | mkisofs -quiet -V 'MIKEOS' -r -J -o disk_images/mikeos.iso -b mikeos.flp disk_images/ || exit 78 | 79 | echo '>>> Done!' 80 | 81 | -------------------------------------------------------------------------------- /build-osx.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | if test "`whoami`" != "root" ; then 4 | echo "[halt] Not running with superuser privileges." 5 | exit 6 | fi 7 | 8 | echo "[okay] Running from superuser" 9 | 10 | vercomp () { 11 | if [[ $1 == $2 ]] 12 | then 13 | return 0 14 | fi 15 | local IFS=. 16 | local i ver1=($1) ver2=($2) 17 | # fill empty fields in ver1 with zeros 18 | for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) 19 | do 20 | ver1[i]=0 21 | done 22 | for ((i=0; i<${#ver1[@]}; i++)) 23 | do 24 | if [[ -z ${ver2[i]} ]] 25 | then 26 | # fill empty fields in ver2 with zeros 27 | ver2[i]=0 28 | fi 29 | if ((10#${ver1[i]} > 10#${ver2[i]})) 30 | then 31 | return 1 32 | fi 33 | if ((10#${ver1[i]} < 10#${ver2[i]})) 34 | then 35 | return 2 36 | fi 37 | done 38 | return 0 39 | } 40 | 41 | nasm_version_check () { 42 | vercomp $nasm_ENV $2 43 | case $? in 44 | 0) op='=';; 45 | 1) op='>';; 46 | 2) op='<';; 47 | esac 48 | if [ $op = '=' ] || [ $op = '>' ] 49 | then 50 | echo "[okay] nasm version at least 2.10.09" 51 | nasm_okay=true 52 | else 53 | echo "[halt] nasm version is too low" 54 | fi 55 | } 56 | 57 | if [[ ! -f /usr/bin/nasm && ! -f /bin/nasm && ! -f /usr/sbin/nasm && ! -f /sbin/nasm && ! -f /usr/local/bin/nasm && ! -f /usr/x11/bin/nasm && ! -f /opt/local/bin/nasm ]] ; then 58 | echo [halt] nasm was not found on the system! Make sure it is named nasm and in the right place. 59 | exit 60 | elif [ -f /opt/local/bin/nasm ] ; then 61 | nasm_version_string_full=$(/opt/local/bin/nasm -v 2>&1) 62 | nasm_ENV=${nasm_version_string_full:13:7} 63 | nasm_version_check $nasm_ENV 2.10.09 64 | if $nasm_okay 65 | then 66 | full_nasm_path="/opt/local/bin/nasm" 67 | fi 68 | elif [ [ -f /usr/bin/nasm ] -a [ ! $nasm_okay ] ] ; then 69 | nasm_version_string_full=$(/usr/bin/nasm -v 2>&1) 70 | nasm_string_trash= 71 | nasm_ENV=${nasm_version_string_full:13:7} 72 | echo $items 73 | nasm_version_check $nasm_ENV 2.10.09 74 | if $nasm_okay 75 | then 76 | full_nasm_path="/usr/bin/nasm" 77 | fi 78 | elif [ [ -f /bin/nasm ] -a [ ! $nasm_okay ] ] ; then 79 | nasm_version_string_full=$(/bin/nasm -v 2>&1) 80 | nasm_ENV=${nasm_version_string_full:13:7} 81 | nasm_version_check $nasm_ENV 2.10.09 82 | if $nasm_okay 83 | then 84 | full_nasm_path="/bin/nasm" 85 | fi 86 | elif [ [ -f /usr/sbin/nasm ] -a [ ! $nasm_okay ] ] ; then 87 | nasm_version_string_full=$(/usr/sbin/nasm -v 2>&1) 88 | nasm_ENV=${nasm_version_string_full:13:7} 89 | nasm_version_check $nasm_ENV 2.10.09 '>=' 90 | if $nasm_okay 91 | then 92 | full_nasm_path="/usr/sbin/nasm" 93 | fi 94 | elif [ [ -f /sbin/nasm ] -a [ ! $nasm_okay ] ] ; then 95 | nasm_version_string_full=$(/sbin/nasm -v 2>&1) 96 | nasm_ENV=${nasm_version_string_full:13:7} 97 | nasm_version_check $nasm_ENV 2.10.09 98 | if $nasm_okay 99 | then 100 | full_nasm_path="/sbin/nasm" 101 | fi 102 | elif [ [ -f /usr/local/bin/nasm ] -a [ ! $nasm_okay ] ] ; then 103 | nasm_version_string_full=$(/usr/local/bin/nasm -v 2>&1) 104 | nasm_ENV=${nasm_version_string_full:13:7} 105 | nasm_version_check $nasm_ENV 2.10.09 106 | if $nasm_okay 107 | then 108 | full_nasm_path="/usr/local/bin/nasm" 109 | fi 110 | elif [ [ -f /usr/x11/bin/nasm ] -a [ ! $nasm_okay ] ] ; then 111 | nasm_version_string_full=$(/usr/x11/bin/nasm -v 2>&1) 112 | nasm_ENV=${nasm_version_string_full:13:7} 113 | nasm_version_check $nasm_ENV 2.10.09 114 | if $nasm_okay 115 | then 116 | full_nasm_path="/usr/x11/bin/nasm" 117 | fi 118 | else 119 | echo "[halt] nasm not found or version is incompatible" 120 | fi 121 | $full_nasm_path -O0 -f bin -o source/bootload/bootload.bin source/bootload/bootload.asm || exit 122 | echo "[okay] Assembled bootloader" 123 | cd source 124 | $full_nasm_path -O0 -f bin -o kernel.bin kernel.asm || exit 125 | cd .. 126 | echo "[okay] Assembled kernel" 127 | cd programs 128 | for i in *.asm 129 | do 130 | /opt/local/bin/nasm -O0 -f bin $i -o `basename $i .asm`.bin || exit 131 | echo "[okay] Assembled program: $i" 132 | done 133 | cd .. 134 | cp disk_images/mikeos.flp disk_images/mikeos.dmg 135 | echo "[okay] Copied floppy image" 136 | dd conv=notrunc if=source/bootload/bootload.bin of=disk_images/mikeos.dmg || exit 137 | echo "[okay] Added bootloader to image" 138 | rm -rf tmp-loop 139 | dev=`hdid -nobrowse -nomount disk_images/mikeos.dmg` 140 | mkdir tmp-loop && mount -t msdos ${dev} tmp-loop && cp source/kernel.bin tmp-loop/ 141 | cp programs/*.bin programs/*.bas programs/sample.pcx tmp-loop 142 | echo "[okay] Added programs to image" 143 | diskutil umount tmp-loop || exit 144 | hdiutil detach ${dev} 145 | rm -rf tmp-loop 146 | echo "[okay] Unmounted floppy image" 147 | rm -f disk_images/mikeos.iso 148 | mkisofs -quiet -V 'MIKEOS' -input-charset iso8859-1 -o disk_images/mikeos.iso -b mikeos.dmg disk_images/ || exit 149 | echo "[okay] Converted floppy to ISO-8859-1 image" 150 | echo "[done] Build completed" 151 | -------------------------------------------------------------------------------- /buildwin.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Build script for Windows 3 | echo. 4 | 5 | echo Assembling bootloader... 6 | cd source\bootload 7 | nasm -O0 -f bin -o bootload.bin bootload.asm 8 | cd .. 9 | 10 | echo Assembling MikeOS kernel... 11 | nasm -O0 -f bin -o kernel.bin kernel.asm 12 | 13 | echo Assembling programs... 14 | cd ..\programs 15 | for %%i in (*.asm) do nasm -O0 -fbin %%i 16 | for %%i in (*.bin) do del %%i 17 | for %%i in (*.) do ren %%i %%i.bin 18 | cd .. 19 | 20 | echo Adding bootsector to disk image... 21 | cd disk_images 22 | partcopy ..\source\bootload\bootload.bin 0 200 mikeos.flp 0 23 | cd .. 24 | 25 | echo Mounting disk image... 26 | imdisk -a -f disk_images\mikeos.flp -s 1440K -m B: 27 | 28 | echo Copying kernel and applications to disk image... 29 | copy source\kernel.bin b:\ 30 | copy programs\*.bin b:\ 31 | copy programs\sample.pcx b:\ 32 | copy programs\*.bas b:\ 33 | 34 | echo Dismounting disk image... 35 | imdisk -D -m B: 36 | 37 | echo Done! 38 | -------------------------------------------------------------------------------- /disk_images/README.TXT: -------------------------------------------------------------------------------- 1 | These are floppy disk and CD-ROM images containing MikeOS and accompanying 2 | programs. mikeos.flp and mikeos.dmg are identical -- the latter can be used 3 | on Mac OS X without having to change the extension. 4 | 5 | You can use 'dd' on Linux or RAWRITE on Windows to write the floppy disk 6 | image to a real floppy. Alternatively, you can burn the .iso to a CD-R and 7 | boot from it in your CD burning utility. 8 | 9 | Note that the CD image is generated automatically from the build scripts, 10 | and uses the floppy image as a boot block (a virtual floppy disk). 11 | 12 | In Linux/Unix, you can create a new floppy image with this command: 13 | 14 | mkdosfs -C mikeos.flp 1440 15 | 16 | The build-linux.sh script does this if it doesn't find mikeos.flp. 17 | 18 | -------------------------------------------------------------------------------- /disk_images/mikeos.dmg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mig-hub/mikeOS/685306a87ddf1a41c069ec7670d24c7d2023ff20/disk_images/mikeos.dmg -------------------------------------------------------------------------------- /disk_images/mikeos.flp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mig-hub/mikeOS/685306a87ddf1a41c069ec7670d24c7d2023ff20/disk_images/mikeos.flp -------------------------------------------------------------------------------- /disk_images/mikeos.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mig-hub/mikeOS/685306a87ddf1a41c069ec7670d24c7d2023ff20/disk_images/mikeos.iso -------------------------------------------------------------------------------- /doc/CREDITS.TXT: -------------------------------------------------------------------------------- 1 | ================================================================== 2 | MikeOS -- Open source 16-bit operating system for x86 PCs 3 | Copyright (C) 2006 - 2014 MikeOS Developers -- see doc/LICENSE.TXT 4 | ================================================================== 5 | 6 | 7 | PROJECT ADMIN (MAIN CODE AND HANDBOOKS) 8 | 9 | * Mike Saunders -- okachi@gmail.com 10 | 11 | 12 | DEVELOPMENT 13 | 14 | * E Dehling 15 | * Ian Seyler 16 | * Joshua Beck 17 | * Justin Tokarchuk 18 | * Matej Horvat 19 | * Michael van Tellingen 20 | * Mike Gonta 21 | * Peter Nemeth 22 | * Paulo Valongo 23 | * Takayoshi Sasano 24 | * Tomasz Gorol 25 | * Tslil Clingman 26 | * Walt Nagel 27 | * Yutaka Saiko 28 | 29 | 30 | WEBSITE, DOCS AND ARTWORK 31 | 32 | * Nitin Reddy Katkam -- logo and site design 33 | * Paul Sommers -- Handbook API reference 34 | * Helen Ewart -- MikeOS cat mascot 35 | 36 | 37 | ================================================================== 38 | 39 | -------------------------------------------------------------------------------- /doc/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | ================================================================== 2 | MikeOS -- License 3 | ================================================================== 4 | 5 | 6 | Copyright (C) 2006 - 2014 MikeOS Developers -- http://mikeos.sourceforge.net 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright 17 | notice, this list of conditions and the following disclaimer in the 18 | documentation and/or other materials provided with the distribution. 19 | 20 | * Neither the name MikeOS nor the names of any MikeOS contributors 21 | may be used to endorse or promote products derived from this software 22 | without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY MIKEOS DEVELOPERS AND CONTRIBUTORS "AS IS" 25 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | ARE DISCLAIMED. IN NO EVENT SHALL MIKEOS DEVELOPERS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 33 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | 36 | ================================================================== 37 | 38 | -------------------------------------------------------------------------------- /doc/handbook-user.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |
75 |
76 | Navigate77 | 78 |Booting 79 |
Running 87 |
Extra 96 | 100 | 101 | |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | The MikeOS User Handbook112 | 113 |For version 4.5, 21 December 2014 - (C) MikeOS Developers114 | 115 |This documentation file explains how to boot and use the MikeOS operating system on a real PC or an 116 | emulator. If you have just downloaded MikeOS and want to run it, this is the guide you need. If you have 117 | any questions, see the MikeOS website for contact details 118 | and mailing list information. 119 | 120 |Click the links on the left to navigate around this guide. 121 | 122 |123 | 124 | 125 | 126 | 127 | 128 | Booting129 | 130 | 131 |Disk images132 | 133 |After you have extracted the MikeOS .zip file, switch into the 134 | disk_images/ directory and you'll see three files: 135 | 136 |
So, these files are virtual disk images that you can write to real floppy disks or 143 | CD-Rs, or run in a PC emulator as described in a moment. 144 | 145 | 146 |147 | 148 | 149 | 150 | Writing151 | 152 |For running MikeOS on a real PC, you will need to write one of the virtual disk images 153 | to physical media. If you have a USB key then this is simple -- we can write the floppy disk 154 | image to the USB key, and the PC will boot it like a virtual floppy. 155 | 156 |On Linux, insert your USB key and unmount it when it appears (but don't remove it). Then open a command line 157 | window and enter dmesg to view the kernel messages. You will see an indication at the end of the messages of the device you just plugged 158 | in -- eg /dev/sdb. Note that you just need the device, eg /dev/sdb, rather than the number (eg /dev/sdb1). Then enter (in the disk_images directory): 159 | 160 |dd if=mikeos.flp of=/dev/sdb161 | 162 | Of course, replace sdb with the device node. The key is now ready for booting. 163 | 164 |On Windows, download the open source Flashnul program, plug in your USB key and 165 | enter flashnul -p to get a list of drives. When you've spotted your USB key, enter 166 | flashnul [number] -L mikeos.flp (in the disk_images directory), replacing [number] 167 | with the number you got before. The key is now ready for booting. 168 | 169 |Note: if you plug your USB key back into the machine, the operating system may try to alter the 170 | partition structure and stop it from working properly. So treat it as a MikeOS-only key until you 171 | want to reformat it for normal use. 172 | 173 |For floppy disks, on Windows you can use a program called RawWrite 174 | to copy mikeos.flp to a floppy disk. On Linux, use the dd 175 | utility like this: 176 | 177 |dd if=mikeos.flp of=/dev/fd0178 | 179 | If you want to run MikeOS on a machine that doesn't have a floppy drive and doesn't 180 | boot from USB keys, you can burn and boot the mikeos.iso CD image. Any decent Windows CD burning software will 181 | allow you to write an ISO image to a CD-R; if you don't have one, try InfraRecorder. 182 | 183 |On Linux, a graphical burning program such as K3b should do the trick, or you can use 184 | the command line: 185 | 186 |cdrecord -dao dev=/dev/cdrom mikeos.iso187 | 188 | 189 | 190 | 191 | 192 | 193 | Real PCs194 | 195 |At a minimum, any 386 PC with 1MB of memory and a keyboard should be able to run MikeOS. In 196 | fact, you may be able to get it running on an older machine -- please do let us know if so! Just 197 | start your PC with the MikeOS floppy, CD-ROM or USB key inserted, and you should see the initial 198 | dialog screen. 199 | 200 |On some systems, you may need to change the boot order in your BIOS so that the PC boots 201 | from the floppy, CD or USB key rather than the hard drive. 202 | 203 | 204 |205 | 206 | 207 | 208 | Emulators209 | 210 |A quick way to try MikeOS, and one that doesn't involve writing disk images to physical media, 211 | is to use an emulator. This is particularly useful if you're writing MikeOS software or changing 212 | the OS as described in the other two Handbooks. 213 | 214 |Some of the best emulators: 215 | 216 |
For VirtualBox and VMware, configure the boot device to use the MikeOS floppy disk or CD ISO image. 224 | With QEMU on Linux, run test-linux.sh, or for QEMU on Windows switch into the directory 225 | where you installed the emulator and enter: 226 | 227 |228 | qemu.exe -L . -m 4 -boot a -fda mikeos.flp -soundhw all -localtime 229 |230 | 231 | You will need to change the path to mikeos.flp accordingly. 232 | 233 | 234 |235 | 236 | 237 | 238 | 239 | 240 | Running241 | 242 | 243 |Usage244 | 245 |When MikeOS starts up, you'll see a dialog box which gives you the option of a program 246 | list of a command line interface. Using the cursor keys and Enter, choose OK for the former 247 | and Cancel for the latter. 248 | 249 |In the program list you can select a .BIN or .BAS program with the up/down cursor 250 | keys and hit Enter to run it. Also, you can press Esc to return back to the original list/CLI 251 | selection screen. 252 | 253 |At the command line, enter DIR to show a list of programs, and HELP 254 | to display inbuilt commands. You can run a program by entering the full filename (eg EDIT.BIN) 255 | or just the name without the extension (eg EDIT). There are also file management commands such 256 | as COPY, REN, DEL and SIZE. 257 | 258 | 259 |260 | 261 | 262 | 263 | Programs264 | 265 |MikeOS includes several programs to perform various tasks and demonstrate features of the OS, such as: 266 | 267 |
Note that FILEMAN.BIN and EDIT.BIN try to write to the floppy drive, 286 | so if you've booted from a CD-R and try to manipulate files you will see write errors as it's a read-only 287 | medium after burning. 288 | 289 | 290 |291 | 292 | 293 | 294 | Copying files295 | 296 |If you've written MikeOS to a real floppy disk, you can just copy extra files 297 | onto that disk in your file manager. But if you want to add files to the floppy disk images, 298 | that requires a bit of extra work -- you need to access the disk image as if it was a real 299 | floppy. First up is Linux: switch to the MikeOS main directory, then enter the following 300 | commands as root: 301 | 302 |303 | mkdir looptmp 304 | mount -o loop -t vfat disk_images/mikeos.flp looptmp 305 |306 | 307 | Now the contents of the MikeOS virtual floppy disk image are accessible in the newly-created looptmp/ 308 | directory. (We have loopback-mounted the disk image onto our filesystem.) Copy your programs into that directory, for example: 309 | 310 |311 | cp MYPROG.BIN looptmp/ 312 |313 | 314 | When you're done, unmount the virtual floppy image and remove the temporary directory: 315 | 316 |317 | umount looptmp 318 | rm -rf looptmp 319 |320 | 321 | You can now write mikeos.flp to a floppy disk or boot it in an emulator. If you want 322 | to recreate the CD ISO image, run build-linux.sh as root; this will update mikeos.iso 323 | with the new floppy contents. 324 | 325 |If you're running Windows, you will need a special program to access mikeos.flp as if it 326 | was a real floppy. One tool you can use is the ImDisk 327 | Virtual Disk Driver; download and run it to install. You can then mount the floppy disk image like this: 328 | 329 |330 | imdisk -a -f mikeos.flp -s 1440K -m B: 331 |332 | 333 | Copy your files into the B: drive. When you are finished, enter: 334 | 335 | 336 | imdisk -d -m B: 337 |338 | 339 | Now the files that you copied to B: have been written into mikeos.flp. 340 | 341 | 342 |343 | 344 | 345 | 346 | Monitor347 | 348 |Yutaka Saito has contributed a MikeOS program that lets you enter machine code in hexadecimal format 349 | and execute it. Run MONITOR.BIN from the command line and you'll be presented 350 | with a '=' prompt. Now you can enter your instructions, or just 'x' to exit back to the OS. 351 | 352 |MikeOS programs are loaded at the 32K (32768) point. The monitor converts hex code and executes 353 | it at location 36864 in RAM -- that is, 4K after the where the monitor program is loaded. This is 354 | so that your code doesn't overwrite the monitor! Consequently, any code you run should 355 | be ORGed to 36864. For example, this is a small MikeOS program which displays the letter 'M' on 356 | the screen. After we've assembled it, we can run ndisasm on the resulting binary 357 | to see the hexadecimal codes: 358 | 359 |360 | 361 |
377 | 378 | (The first three lines are merely assembly directives, so they don't generate any code.) Now 379 | that we have the hex codes, we can enter them into the monitor. Note that the code must be terminated 380 | with a dollar sign ($) character, and spaces are allowed. So, you can enter at the '=' prompt: 381 | 382 |BE0790 E8FD6F C3 4D00$383 | 384 | When you enter this, the monitor will convert the hex codes to machine code at location 36864 in 385 | RAM, and call that location to execute it. (Just like normal MikeOS programs, you should finish with 386 | a ret instruction.) After execution, you'll be returned to the monitor. You can then 387 | enter 'r' to re-run the converted code, or 'x' to exit. 388 | 389 | 390 |391 | 392 | 393 | 394 | Serial port395 | 396 |You can use MikeOS as a Minicom-like serial terminal emulator with SERIAL.BIN. This lets 397 | you connect a MikeOS machine to, for instance, a UNIX machine, and operate the UNIX machine from 398 | MikeOS. Connect a serial (null-modem) cable between the two machines, then set up your UNIX machine 399 | with a terminal session on the serial port. 400 | 401 |For instance, if you have a Linux machine, you would add a line like this to /etc/inittab: 402 | 403 |404 | T0:2345:respawn:/sbin/getty/ -L ttyS0 9600 vt100 405 |406 | 407 | When you restart your Linux machine, it will wait for a login on the serial port. Connect 408 | the null-modem cable to a MikeOS machine, and run SERIAL.BIN in MikeOS. You can now enter your 409 | username and password to log in. 410 | 411 |Note that MikeOS configures the serial port to be 9600 baud, no parity, 8 data bits, 1 stop 412 | bit. If you wish to change these settings, edit source/features/serial.asm and see the port 413 | port setup code at the start of the file (then rebuild MikeOS as described in the System Developer Handbook). 414 | Also note that only a handful of VT100 commands have been implemented at present, so programs which do complicated 415 | things with the screen (such as Emacs) may not display properly. 416 | 417 |To exit the program, press the F8 key. (You can change this to a different key by editing 418 | the source code near the start of programs/serial.asm.) 419 | 420 | 421 |422 | 423 | 424 | 425 | 426 | 427 | Extra428 | 429 | 430 |Help431 | 432 | 433 |If you have any questions about MikeOS, or you're developing a similar OS and want 434 | to share code and ideas, go to the MikeOS website 435 | and join the mailing list as described. You can then email 436 | mikeos-developer@lists.berlios.de 437 | to post to the list. 438 | 439 | 440 |441 | 442 | 443 | 444 | License445 | 446 |MikeOS is open source and released under a BSD-like license (see doc/LICENSE.TXT 447 | in the MikeOS .zip file). Essentially, it means you can do anything you like with the 448 | code, including basing your own project on it, providing you retain the license file and give credit 449 | to the MikeOS developers for their work. 450 | 451 | 452 |453 | 454 | 455 | 456 | 457 | 458 | |
459 |