Skip to content

Commit

Permalink
OS/1 : 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
StjepanBM1 committed Apr 6, 2023
1 parent 5cb05f6 commit 342dbdc
Show file tree
Hide file tree
Showing 50 changed files with 2,015 additions and 2,582 deletions.
674 changes: 0 additions & 674 deletions LICENSE.txt

This file was deleted.

30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@

all: bootld kernel diskim run
all: boot kern bin disk run

bootld:
make -C boot
boot:
make -C bootld

kernel:
make -C kern
kern:
make -C kernel
bin:
cat obj/boot16.bin obj/kern16.bin > obj/os1-300.bin

diskim:
cat bin/boot16.bin bin/kern16.bin > bin/os1-200.bin

dd if=/dev/zero of=disk.img bs=512 count=720
dd if=bin/os1-200.bin of=disk.img conv=notrunc
disk:
dd if=/dev/zero of=img/disk.img bs=512 count=1440
dd if=obj/os1-300.bin of=img/disk.img conv=notrunc

run:
qemu-system-i386 -fda disk.img
qemu-system-i386 -fda img/disk.img

clean:
make -C boot clean
make -C kern clean
rm bin/*
rm disk.img
make -C bootld clean
make -C kernel clean
rm obj/*
rm img/*
23 changes: 15 additions & 8 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
Operating System One
Version 2.0.0
Operating System One
======================================================

Operating System One 2.0.0 or OS/1 2.0.0 is the second verison
of Operating System One. Version 2.0.0 is written in assembly for the
Intel i386 platform, and is compiled with GNU Assembler. Version 2.0.0
features a new UI design. If you wish to build OS/1 2.0.0 you need a
i386-elf cross-compiler. OS/1 2.0.0 is provided with a "weird" system
called SCE.
Operating System One (shortened to OS/1) is
a simple 16-bit operating system written in
assembly under a cross-compiled GNU Assembler
for the Intel i386 CPU.

To compile OS/1 just run : `make` in the root
of the directory.

If you encounter any errors file them on the
Github repository.

List of software needed to build Oklahoma :
* i386-elf GNU Binutils
* QEMU (or any other emulator)
Binary file removed bin/boot16.bin
Binary file not shown.
Binary file removed bin/kern16.bin
Binary file not shown.
Binary file removed bin/os1-200.bin
Binary file not shown.
12 changes: 0 additions & 12 deletions boot/Makefile

This file was deleted.

56 changes: 0 additions & 56 deletions boot/blib16.S

This file was deleted.

63 changes: 0 additions & 63 deletions boot/boot16.S

This file was deleted.

34 changes: 0 additions & 34 deletions boot/boot16.ld

This file was deleted.

13 changes: 13 additions & 0 deletions bootld/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

AS=i386-elf-as
LD=i386-elf-ld
LF=-Tlink16.ld *.o -o ../obj/boot16.bin

all:
$(AS) boot16.S -o boot16.o
$(AS) libb16.S -o libb16.o

$(LD) $(LF)

clean:
rm *.o
50 changes: 50 additions & 0 deletions bootld/boot16.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

.section .text.boot
.global _boot16
.code16

_boot16:
xor %ax, %ax
mov %ax, %ds
mov %ax, %ss
mov $_boot16,%sp
cld

mov $0x03, %ax
int $0x10

mov $0x1003,%ax
mov $0x00, %bx
int $0x10

mov $0x11, %ah
mov $0x11, %al
int $0x10

mov $msg0, %si
call puts16

call delay

mov $msg1, %si
call puts16

call delay

mov $msg2, %si
call puts16

call delay
call delay

call disk_read

jmp KERN

1: cli
jmp 1b

.section .rodata
msg0: .asciz " === Operating System One ... Version 3.0.0 === \r\n"
msg1: .asciz "\r\n {0} : Starting the system disk..."
msg2: .asciz "\r\n {1} : Reading the disk..."
61 changes: 61 additions & 0 deletions bootld/libb16.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

.section .text
.global puts16
.global delay
.global disk_read
.global KERN
.set KERN, 0x7e00
.code16

puts16:
lodsb

or %al, %al
jz .done

mov $0x0e, %ah
mov $0x00, %bh
int $0x10

jmp puts16

.done:
ret

delay:
mov $0x0f, %cx
mov $0x4240, %dx
mov $0x86, %ah
int $0x15
ret

disk_read:
mov $0x02, %ah
mov $0x7e00, %bx
mov $65, %al
mov (BOOT), %dl
mov $0x00, %ch
mov $0x00, %dh
mov $0x02, %cl
int $0x13

jc disk_fail

ret

disk_fail:
mov $err0, %si
call puts16

mov $0x00, %ah
int $0x16

int $0x19

.halt:
jmp .halt

# .section .data
BOOT: .byte 0
.section .rodata
err0: .asciz "\r\n Error {1} : Failed to read the system disk | Any key to restart..."
22 changes: 22 additions & 0 deletions bootld/link16.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

OUTPUT_FORMAT(binary);
ENTRY(_boot16);

SECTIONS
{
. = 0x7c00;
.text : SUBALIGN(0) {
*(.text.boot);
*(.text)
}

.rodata : SUBALIGN(0) { *(.rodata) }
.data : SUBALIGN(0) { *(.data) }
.sig : AT(0x7DFE) { SHORT(0xaa55); }

/DISCARD/ : {
*(.comment);
*(.note*)
}

}
Binary file removed disk.img
Binary file not shown.
Binary file added img/disk.img
Binary file not shown.
Loading

0 comments on commit 342dbdc

Please sign in to comment.