Skip to content

Commit

Permalink
v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
StjepanBM1 committed Apr 9, 2024
1 parent 76f3e4d commit 7021e1a
Show file tree
Hide file tree
Showing 57 changed files with 2,334 additions and 4,992 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.vscode/***
*.o
*.s_o
*.o
*.img
*.sys
*.bin
25 changes: 25 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
26 changes: 1 addition & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,18 @@ boot:
kernel:
make -f kernel/kernel.mk

#
# Double Density 3.5" 720KiB disks
#
disk:
dd if=/dev/zero of=$(FD_IMG) bs=512 count=1440
dd if=$(BOOT_FILE) of=$(FD_IMG) bs=512 count=1 conv=notrunc
dd if=$(KERN_FILE) of=$(FD_IMG) bs=512 seek=1 conv=notrunc

#
# CD ISO - uses high density 1.44MB disk image
#
cdrom: base
dd if=/dev/zero of=$(FD_IMG) bs=512 count=2880
dd if=$(BOOT_FILE) of=$(FD_IMG) bs=512 count=1 conv=notrunc
dd if=$(KERN_FILE) of=$(FD_IMG) bs=512 seek=1 conv=notrunc

mkisofs -quiet -V 'os1-v550' \
-input-charset iso8859-1 \
-o img/disk.iso \
-b disk.img \
img

run:
qemu-system-i386 -fda $(FD_IMG)

run-cd: cdrom
qemu-system-i386 -cdrom $(CD_IMG)

utils:
make -f utils/utils.mk
qemu-system-i386 -drive format=raw,file="$(FD_IMG)",index=0,if=floppy

.PHONY: clean
clean:
make -f boot/boot.mk clean
make -f kernel/kernel.mk clean
make -f utils/utils.mk clean

rm $(FD_IMG)
rm $(CD_IMG)
60 changes: 36 additions & 24 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,43 @@
-= About =-
Operating System/1 or OS/1 for short is a
simple 16-bit OS written in x86 assembly that runs
in Unreal mode.
in huge unreal mode.

It features a graphical environment called
Pinboard, a shell called MP-OS/1 (the real name is
quite long), and as of version 5.4.0 a functioning
file system called Bad Block File System (BBFS).
Version 6.0.0 removed some stuff, but most
importantly it added a functioning file system called
Low Performance File System (LPFS). It can handle files
up to 18KiB in size (36 512B sectors).

Pinboard has been removed from the base
system and will be available with other software on a
special disk called "OS/1 Utilities disk".

(to see the logo of OS/1 check OS-1-LOGO.png)

-= CHANGES (as of v5.5.0) =-
-= CHANGES (as of v6.0.0) =-
- BBFS:
> removed

- LDFS:
> removed

- LPFS:
> new FS for OS/1
> read, write or remove files up to 18KiB
in size
> format command

- IVT:
> custom interrupts to make developing
software for OS/1 easier

- MP:
> more disk commands
> added cmd. line arguments
> a text editor called "td" added

- Pinboard:
> added an About tab to the top bar
> small changes to Home tab
> removed from the base OS

-= System Requirements =-

Expand All @@ -42,25 +66,13 @@
- an emulator (QEMU recommended)
- make

When you wish to copile run this command:
When you wish to compile run this command:
make -i clean && make

-= Running on real hardware =-
While it is recommended that you run OS/1
in an emulator, there have been attempts to run it
on real hardware. So far OS/1 has proven most
successful running on a COMPAQ DeskPro 386 with VGA
display and 1MB of RAM. While I have tested that it
can work with even less RAM, it is quite slow when
ran with less than 512KB of RAM.

Also while VGA display isn't necessary I do
recommended it, since white foreground color will
start blinking on a non-VGA display.

If you do successfully run OS/1 on a real
computer, please do send me a message so I can add
that machine to the list of PCs that have ran OS/1!
To be honest, I have no idea if this will run
on real hardware. If you have the time, do test
OS/1 6.0.0 on real hardware and tell me how it went.

-= Additional =-
If any bugs or issues have been found do
Expand Down
Binary file removed bin/boot.sys
Binary file not shown.
Binary file removed bin/kernel.sys
Binary file not shown.
2 changes: 1 addition & 1 deletion boot/boot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ override OBJ := $(ASM:.S=.o)
all: $(BIN)

$(BIN): $(OBJ)
$(LD) -Tboot/x86.ld $(OBJ) -o $@
$(LD) -Tboot/boot_x86.ld $(OBJ) -o $@

%.o: %.S
$(AS) $< -o $@
Expand Down
221 changes: 221 additions & 0 deletions boot/boot_x86.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@

.code16
.global _entry
.section .text

_entry:
jmp _start
nop

#
# Low Performance File System (LPFS) header
#

_disk_volume_label: .asciz "OPERATING SYSTEM/1 SYSTEM DISK" # 31chars (+1 for '\0')
_disk_sector_size: .word 512 # Define a size of a sector in bytes
_maximal_dir_size: .word 1024 # Maximum directory size of 1024KiB (~1MB)
_minimum_dir_size: .word 1 # Minimum directory size of 1KiB
_minimal_file_size: .word 1 # Minimum file size of 1KiB (1024 bytes - 2 sectors)
_maximum_file_size: .word 18 # Maximum file size of 18KiB (16384 bytes - 2 tracks [18 sectors per track])
_disk_id_number: .byte 79, 83, 47, 49, 20, 86, 54, 46, 48, 46, 48, 20 # 12 byte disk id nubmer

#
# Main function of the bootloader
#
_start:
# save the boot device
movb %dl, _boot_dev

# clear scr.
mov $0x03, %ax
int $0x10

# Set pallete register
mov $0x1003, %ax
mov $0x00, %bl
int $0x10

# Set up the font
mov $0x11, %ah
mov $0x11, %al
int $0x10

# Stack
cli
mov $0x9000,%ax
mov %ax, %ss
mov $0xF800,%sp
sti

# boot message
mov $_msg_0, %si
call _print

#
# Check for kernel file
#
# like dos' io.sys the
# kernel also needs to
# be on a specific disk
# position
#
_check_file:
mov $_msg_1,%si
call _print

xor %ax, %ax
mov %ax, %es

mov $0x02, %ah
mov $0x01, %al # Load 32 sectors (16KiB) of data
mov $0x0500, %bx # to address 0x0500
mov $0x00, %ch
mov $0x02, %cl # starting from the 2nd sector
mov $0x00, %dh
movb (_boot_dev),%dl # on the boot device
int $0x13

xor %ax, %ax
xor %cx, %cx

mov $0x0500, %si
mov $_file_name,%di
mov $16, %cx

_check_loop:
movsb
loop _check_loop

mov $0x00, %al
stosb

mov $_file_name,%si
mov $_file, %di
call _strcmp

jc _load_file

mov $_err2, %si
call _print

jmp _end

#
# Load the kernel file to (phys. mem.) 0x0500
#
_load_file:
mov $_msg_2,%si
call _print

xor %ax, %ax
mov %ax, %es

mov $0x02, %ah
mov $0x20, %al # Load 32 sectors (16KiB) of data
mov $0x0500, %bx # to address 0x0500
mov $0x00, %ch
mov $0x02, %cl # starting from the 2nd sector
mov $0x00, %dh
movb (_boot_dev),%dl # on the boot device
int $0x13

jc _disk_error

mov $_start_k, %si
call _print

jmp 0x0500

#
# Clear ints. and halt
#
_end:
cli
hlt

#
# If a int 0x13 carry flag is set jump heres
#
_disk_error:
mov $_err, %si
call _print

xor %ax, %ax
int $0x16

int $0x19

#
# Cannot find kernel file
#
_no_kernel:
mov $_err2, %si
call _print

xor %ax, %ax
int $0x16

int $0x19

#
# Prints out string stored in %si
#
_print:
lodsb

or %al, %al
jz .p_done

mov $0x0e, %ah
int $0x10

jmp _print

.p_done:
ret

#
# Compare a string in %si with a string in %di
#
_strcmp:
_str_loop:
mov (%si), %al
mov (%di), %bl
cmp %bl, %al
jne _not_equal

cmp $0x00, %al
je _equal

inc %di
inc %si

jmp _str_loop

_not_equal:
clc
ret

_equal:
stc
ret

#
# Variables
#
.section .rodata

_msg_0: .asciz "\xDB\xDB\xDB OS/1\n\r"
_msg_1: .asciz "Searching for the kernel file...\n\r"
_msg_2: .asciz "Loading the kernel file...\n\r"

_err: .asciz "Disk read error\n\rAny key to reboot"
_err2: .asciz "Cannot find the kernel file on the required locaton\r\nAny key to reboot"

_start_k: .asciz "Starting OS/1...\r\n"

_file: .asciz "KERNEL-6-0-0.SYS" # The file we are looking for

.section .data16
_boot_dev: .byte 0
_file_name: .fill 16,1,0 # 12 char file name + 1 char for . + 3 chars for file exst.
Loading

0 comments on commit 7021e1a

Please sign in to comment.