Giter VIP home page Giter VIP logo

bootos's Introduction

 _                 _    ____   _____ 
| |               | |  / __ \ / ____|
| |__   ___   ___ | |_| |  | | (___  
| '_ \ / _ \ / _ \| __| |  | |\___ \ 
| |_) | (_) | (_) | |_| |__| |____) |
|_.__/ \___/ \___/ \__|\____/|_____/                                                                           

bootOS operating system in 512 bytes (boot sector)
by Oscar Toledo G. Jul/22/2019

http://nanochess.org
https://github.com/nanochess

It's compatible with 8088 (the original IBM PC).

If you want to assemble it, you must download the Netwide Assembler
(nasm) from www.nasm.us

Use this command line:

  nasm -f bin os.asm -l os.lst -o os.img


What is bootOS:

  bootOS is a monolithic operating system that fits in
  one boot sector. It's able to load, execute, and save
  programs. Also keeps a filesystem. It can work with
  any floppy disk size starting at 180K.

  It relocates itself at 0000:7a00 and requires further
  768 bytes of memory starting at 0000:7700.

  This operating system runs programs as boot sectors
  at 0000:7c00. 

  It provides a single service to exit to the operating
  system using int 0x20.


Filesystem organization:

  bootOS uses tracks from 0 to 32, side 0, sector 1.

  The directory is contained in track 0, side 0, sector 2.

  Each entry in the directory is 16 bytes wide, and
  contains the ASCII name of the file finished with a
  zero byte. A sector has a capacity of 512 bytes, it
  means only 32 files can be kept on a floppy disk.

  Deleting a file is a matter of zeroing a whole entry.

  Each file is one sector long. Its location in the
  disk is derived from its position in the directory.

  The 1st file is located at track 1, side 0, sector 1.
  The 2nd file is located at track 2, side 0, sector 1.
  The 32nd file is located at track 32, side 0, sector 1.
 

Starting bootOS:

  Just make sure to write it at the boot sector of a
  floppy disk. It can work with any floppy disk size
  (360K, 720K, 1.2MB and 1.44MB) and it will waste the
  disk space as only uses the first two sectors of the
  disk and then the first sector of each following
  track.

  For emulation make sure to deposit it at the start
  of a .img file of 360K, 720K or 1440K. (at least
  VirtualBox detects the type of disk by the length
  of the image file)

  For Mac OS X and Linux you can create a 360K image
  in this way:

    dd if=/dev/zero of=oszero.img count=719 bs=512
    cat os.img oszero.img >osbase.img

  Replace 719 with 1439 for 720K, or 2879 for 1.44M.

  Tested with VirtualBox for Mac OS X running Windows XP
  running it, it also works with qemu:

    qemu-system-x86_64 -fda os.img

Running bootOS:

  The first time you should enter the 'format' command,
  so it initializes the directory. It also copies itself
  again to the boot sector, this is useful to init new
  disks.

bootOS commands:

  ver           Shows the version (none at the moment)
  dir           Shows the directory's content.
  del filename  Deletes the "filename" file.
  format        As explained before.
  enter         Allows to enter up to 512 hexadecimal
                bytes to create another file.

                Notice the line size is 128 characters so
                you must break the input into chunks of
                4, 8 or 16 bytes.

For example: (Character + is Enter key)

  $enter+
  hbb 17 7c 8a 07 84 c0 74 0c 53 b4 0e bb 0f 00 cd+
  h10 5b 43 eb ee cd 20 48 65 6c 6c 6f 2c 20 77 6f+
  h72 6c 64 0d 0a 00+
  h+
  *hello+
  $dir+
  hello
  $hello+
  Hello, world
  $

bootOS programs: (Oh yes! we have software support)

  fbird         https://github.com/nanochess/fbird
  Pillman       https://github.com/nanochess/pillman
  invaders      https://github.com/nanochess/invaders
  bootBASIC     https://github.com/nanochess/bootBASIC

You can copy the machine code directly using the 'enter'
command, or you can create a file with signature bytes
with the same command and later copy the binary into the
.img file using the signature bytes as a clue to locate
the right position in the image file.

Or you can find a pre-designed disk image along this Git
with the name osall.img

Enjoy it!



>> ATTENTION <<        

Would you like to learn 8086/8088 programming? Then you
must get my new book Programming Boot Sector Games including
a 8086/8088 crash course!

Now available from Lulu:

  Soft-cover
    http://www.lulu.com/shop/oscar-toledo-gutierrez/programming-boot-sector-games/paperback/product-24188564.html

  Hard-cover
    http://www.lulu.com/shop/oscar-toledo-gutierrez/programming-boot-sector-games/hardcover/product-24188530.html

These are some of the example programs documented profusely
in the book:

  * Guess the number.
  * Tic-Tac-Toe game.
  * Text graphics.
  * Mandelbrot set.
  * F-Bird game.
  * Invaders game.
  * Pillman game.
  * Toledo Atomchess.
  * bootBASIC language.

bootos's People

Contributors

nanochess avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.