Skip to content

Commit

Permalink
Imported PSOS v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Stockett committed Dec 10, 2016
0 parents commit 95e4879
Show file tree
Hide file tree
Showing 35 changed files with 3,270 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#PSOS (Pretty Simple/Stupid Operating System)
##Version 1.0

####Description:

PSOS is a (very) basic x86 16-bit operating system written in assembly.
Currently all PSOS is, is a simple command line with 4 commands: CIRCLE, CLEAR, HELP, and VGATEST.

- CIRCLE demonstrates VGA mode 13h by drawing a circle.
- CLEAR clears the screen.
- HELP displays a help message.
- VGATEST displays the possible colors in VGA mode 13h.

Note that these commands are in all-caps.
This is because PSOS's keyboard driver does not currently support lowercase.
The only other feature is text scrolling.
If text reaches the bottom of the screen, it is scrolled up.
This is still very buggy.

Here is what I hope to accomplish in the next version:

- Port PSOS to C
- Implement exception handling
- Add more commands
- Implement filesystem
- Implement VESA driver

####Compiling:

Compilation Requirements:

- Basic Nix* setup, or sad Windows imitation ([MinGW](http://mingw.org/), [Cygwin](https://cygwin.com/), [Bash for Windows](https://msdn.microsoft.com/en-us/commandline/wsl/about), etc.)
- [GNU Make](https://www.gnu.org/software/make/)
- [NASM (Netwide Assembler)](http://www.nasm.us/)

To compile, just run `make` in the top level directory.
This should produce a file called PSOS.bin in the bin/ folder.

####Installing:

To install PSOS on a storage device, use the command: `dd if=PSOS.bin of=/dev/devicename && sync`.
*Make sure that you do not accidentally install PSOS on your hard drive.*
If you do, make sure you send me a video so I can laugh at you.

####Running:

The image file is called PSOS.bin and is located in the bin/ folder.
This is a raw binary image. Not an ISO.
Some emulators might have trouble with the format.
If you have trouble, try emulating it as a floppy drive.
PSOS uses BIOS functions to operate. For systems with UEFI, you may need to enable legacy support in your firmware settings.
52 changes: 52 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
PSOS (Pretty Simple/Stupid Operating System)
Version 1.0

Description:

PSOS is a (very) basic x86 16-bit operating system written in assembly.
Currently all PSOS is, is a simple command line with 4 commands: CIRCLE, CLEAR, HELP, and VGATEST.

- CIRCLE demonstrates VGA mode 13h by drawing a circle.
- CLEAR clears the screen.
- HELP displays a help message.
- VGATEST displays the possible colors in VGA mode 13h.

Note that these commands are in all-caps.
This is because PSOS's keyboard driver does not currently support lowercase.
The only other feature is text scrolling.
If text reaches the bottom of the screen, it is scrolled up.
This is still very buggy.

Here is what I hope to accomplish in the next version:

- Port PSOS to C
- Implement exception handling
- Add more commands
- Implement filesystem
- Implement VESA driver

Compiling:

Compilation Requirements:

- Basic Nix* setup, or sad Windows imitation (MinGW, Cygwin, Bash for Windows, etc.)
- GNU Make
- NASM (Netwide Assembler)

To compile, just run `make` in the top level directory.
This should produce a file called PSOS.bin in the bin/ folder.

Installing:

To install PSOS on a storage device, use the command: `dd if=PSOS.bin of=/dev/devicename && sync`.
*Make sure that you do not accidentally install PSOS on your hard drive.*
If you do, make sure you send me a video so I can laugh at you.

Running:

The image file is called PSOS.bin and is located in the bin/ folder.
This is a raw binary image. Not an ISO.
Some emulators might have trouble with the format.
If you have trouble, try emulating it as a floppy drive.
PSOS uses BIOS functions to operate.
For systems with UEFI, you may need to enable legacy support in your firmware settings.
Binary file added bin/PSOS.bin
Binary file not shown.
38 changes: 38 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#PSOS Version 1.0
#Copyright (C) 2016 Ben Stockett.

#This file is part of PSOS (Pretty Simple/Stupid Operating System).

#PSOS is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.

#PSOS is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with PSOS. If not, see <http://www.gnu.org/licenses/>.

FLAGS := -Isrc -f bin

all: PSOS.bin clean

PSOS.bin: loader.bin kernel.bin
cat bin/loader.bin bin/kernel.bin > bin/$@

loader.bin: src/loader/loader.asm
nasm $(FLAGS) -Isrc/loader $^ -o bin/$@

kernel.bin: src/kernel/kernel.asm
nasm $(FLAGS) -Isrc/kernel $^ -o bin/$@

fs.bin: src/fs/fs.asm
make -C src/fs/prg
nasm $(FLAGS) -Isrc/fs $^ -o bin/$@

.PHONY: clean
clean:
rm bin/loader.bin bin/kernel.bin
30 changes: 30 additions & 0 deletions src/fs/fs.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
;PSOS Version 1.0
;Copyright (C) 2016 Ben Stockett.

;This file is part of PSOS (Pretty Simple/Stupid Operating System).

;PSOS is free software: you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
;the Free Software Foundation, either version 3 of the License, or
;(at your option) any later version.

;PSOS is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.

;You should have received a copy of the GNU General Public License
;along with PSOS. If not, see <http://www.gnu.org/licenses/>.

db "/prg/help.bin", 0
align 512
;dw 0x0
;align 512

;db "help", 0x0
;align 16
;dw 0x0
;incbin "/prg/help.bin"
;align 512


88 changes: 88 additions & 0 deletions src/fs/prg/circle/circle.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
;PSOS Version 1.0
;Copyright (C) 2016 Ben Stockett.

;This file is part of PSOS (Pretty Simple/Stupid Operating System).

;PSOS is free software: you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
;the Free Software Foundation, either version 3 of the License, or
;(at your option) any later version.

;PSOS is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.

;You should have received a copy of the GNU General Public License
;along with PSOS. If not, see <http://www.gnu.org/licenses/>.

[BITS 16]
[ORG 0x7C00]

%include "/loader/loader.inc"
%include "/kernel/kernel.inc"

CIRCLE:

mov bp, sp
sub sp, 8

fld dword [Radius]
fld dword [Step]
fldz

push 0x13
call SetVideoMode
add sp, 0x2

xor cx, cx

.Loop:

fld st0
fcos
fmul st3
fistp dword [bp - 0x8]

fld st0
fsin
fmul st3
fistp dword [bp - 0x4]

fadd st1

add dword [bp - 0x8], 160
add dword [bp - 0x4], 100

push word [bp - 0x8]
push word [bp - 0x4]
push 127
call SetPixel
add sp, 0x6

cmp cx, 0xFFFF
je .Return

inc cx

jmp .Loop

.Return:

push 5000
call Sleep
add sp, 0x2

push 0x3
call SetVideoMode
add sp, 0x2

call CLEAR

add sp, 0x8

ret

CS_CIRCLE: db "CIRCLE", 0x0
Radius: dd 50.0
Step: dd 1.0
27 changes: 27 additions & 0 deletions src/fs/prg/clear/clear.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
;PSOS Version 1.0
;Copyright (C) 2016 Ben Stockett.

;This file is part of PSOS (Pretty Simple/Stupid Operating System).

;PSOS is free software: you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
;the Free Software Foundation, either version 3 of the License, or
;(at your option) any later version.

;PSOS is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.

;You should have received a copy of the GNU General Public License
;along with PSOS. If not, see <http://www.gnu.org/licenses/>.

CLEAR:

mov word [CharX], 0x0

call ClearScreen

ret

CS_CLEAR: db "CLEAR", 0x0
Loading

0 comments on commit 95e4879

Please sign in to comment.