An operating system
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
CrazyEttin 8baa294947 Rewrite everything to be more elegant, prevent changing to non-existent drives, add the option to quit print and list while paging and modify the readme accordingly, and add info on the EttinOS-extra repository to the readme. 4 недель назад
src Rewrite everything to be more elegant, prevent changing to non-existent drives, add the option to quit print and list while paging and modify the readme accordingly, and add info on the EttinOS-extra repository to the readme. 3 недель назад
EttinOS.svg Rename type to print and modify the readme and make.sh accordingly, fix a bug where the system would crash if you tried to access a non-existent or empty drive, add a section for known bugs in the readme, tidy up the code a bit, and add a logo. 1 месяц назад
LICENSE.MD Get loadf variables from the disk description table instead of hardcoding them, tidy up the make script a bit, add contributors to the copyright statement, and change the phrasing of the readme slightly. 1 месяц назад
README.MD Rewrite everything to be more elegant, prevent changing to non-existent drives, add the option to quit print and list while paging and modify the readme accordingly, and add info on the EttinOS-extra repository to the readme. 3 недель назад
make.sh Rename type to print and modify the readme and make.sh accordingly, fix a bug where the system would crash if you tried to access a non-existent or empty drive, add a section for known bugs in the readme, tidy up the code a bit, and add a logo. 1 месяц назад

README.MD

EttinOS

EttinOS is a minimalist 16-bit DOS-like hobbyist operating system for the IBM Personal Computer and compatible machines. Its git repository can be found at https://ahti.space/git/crazyettin/EttinOS and that of EttinOS-extra, a collection of programs for the system, at https://ahti.space/git/crazyettin/EttinOS-extra.

System requirements

  • An Intel 8086 or compatible CPU
  • BIOS, or UEFI in legacy mode
  • 64 KiB of RAM
  • 1-4 floppy disk drives (hard disk drives are not supported)

Building

Build dependencies:

  • A Unix-like operating system
  • coreutils
  • dosfstools
  • mtools
  • nasm
  • rw (optional)

Running make.sh will build EttinOS and create a bootable 360 KiB 5.25" floppy disk image named EttinOS.img and a source image of the same format named EttinOS-src.img. To get 1440 KiB 3.5" images instead use the argument -1440. If you want to use another format you will have to build the system manually.

Usage

The input system is inspired by typewriters. Typing a character overwrites the cursor location and the erase (=tab) key erases it. The space and backspace keys move the cursor.

EttinOS assigns the drives letters from A to D and uses the FAT12 file system. The hidden and total sectors entries of the BIOS parameter block, the entire extended BIOS parameter block, file attributes, and the file access date are not supported and are ignored if present: as a result disk labels and subdirectories are not supported. Drive letters and file names are case-insensitive and the latter follow the 8.3 format. Text files use CRLF line endings.

Drives and files are specified as ([A-D]:) and ([A-D]:)FILENAME.EXT respectively. Specifying the current drive, indicated in the prompt, is optional.

A command can be followed by arguments separated from eachother and the command with spaces. Extra spaces are ignored. Commands other than changing the drive are stored as external programs: the command for a program is its file specification without the extension.

Commands included in EttinOS:

  • [A-D]:: Change the drive.
  • ECHO: Print a message. Syntax: ECHO Message to be printed
  • HELLO: Print "Hello world!".
  • LIST: Print a list of the files on a drive. Syntax: LIST DRIVE
  • PRINT: Print a text file. Syntax: PRINT FILE

Both LIST and PRINT page their output if all of it does not fit on the screen at the same time. Press any key other than escape to continue printing after each screen or escape to quit the program.

Programming

EttinOS has a flat address space of 64 KiB. The data, stack, and extra segments are set at the beginning of the RAM and the system stack at the end of the address space. Programs are loaded at address 0x3000, the number of the current drive is loaded in DL, and SI is pointed at the command tail (a string ending in a null) when the program is executed. The stack is reset back to the end of the address space after a program has finished running.

System calls:

  • Interrupt 0x20: Return to the shell.
  • Interrupt 0x21: Input and output:
    • AH = 0x0: Print a string ending in a null from SI.
    • AH = 0x1: Read a string ending in a null of at most AL characters to DI until a return.
    • AH = 0x2: Print a string ending in a null from SI followed by a CRLF.
    • AH = 0x3: Read a string ending in a null of at most AL characters to DI until a return and print a CRLF.
  • Interrupt 0x22: Disk operations:
    • AH = 0x0: Load a file named at SI as a string ending in a null to the offset BX and store the file size in CX and the error codes in AL: * AL = 0x0: Succesful load * AL = 0x1: Drive not found * AL = 0x2: Unable to read disk * AL = 0x4: File or command not found * AL = 0x8: Not enough memory
    • AH = 0x1: Save a file (under construction).

Known bugs

  • Trying to access a disk of different format than the current one can crash the system.
  • Files beyond the ~40th one on the disk might not load properly.