-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e420756
commit c22917b
Showing
40 changed files
with
469 additions
and
2,005 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
|
||
all: boot kern bin disk run | ||
all: bootld kernel disk run | ||
|
||
boot: | ||
make -C bootld | ||
bootld: | ||
make -C boot | ||
|
||
kern: | ||
make -C kernel | ||
bin: | ||
cat obj/boot16.bin obj/kern16.bin > obj/os1-300.bin | ||
kernel: | ||
make -C dune | ||
|
||
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 | ||
cat bin/bootld.bin bin/dune.bin > bin/os1.bin | ||
dd if=/dev/zero of=disk.img bs=512 count=360 | ||
dd if=bin/os1.bin of=disk.img conv=notrunc | ||
|
||
run: | ||
qemu-system-i386 -fda img/disk.img | ||
qemu-system-i386 -fda disk.img | ||
|
||
clean: | ||
make -C bootld clean | ||
make -C kernel clean | ||
rm obj/* | ||
rm img/* | ||
rm disk.img bin/*.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
NASM := nasm -f bin | ||
|
||
override BOOT := bootld.bin | ||
|
||
.PHONY: all | ||
all: $(BOOT) | ||
|
||
$(BOOT): | ||
$(NASM) boot16.nasm -o ../bin/$(BOOT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
org 0x7c00 ; Start @ 0x0000:0x7c00 | ||
cpu 286 ; Target 80286 CPU | ||
bits 16 ; Generate 16-bit code | ||
jmp _start ; Skip to _start | ||
|
||
; Include bootloader lib. | ||
%include "lib16.nasm" | ||
|
||
_start: ; Main bootloader func. | ||
mov [bootd],dl ; Boot dev. value | ||
|
||
mov bp, 0x7c00 | ||
mov sp, bp | ||
|
||
mov si, msg_s ; Print start message | ||
call _putsb | ||
|
||
mov si, msg_l ; Print loading message | ||
call _putsb | ||
|
||
call disk_read ; Read disk function | ||
|
||
jmp KERNEL ; Jump to the kernel addr. | ||
|
||
; Strings | ||
msg_s: db 13,10,"Operating System/1 Version 4.0.0",13,10,0 | ||
msg_l: db "Starting OS/1...",13,10,0 | ||
|
||
times 510-($-$$) db 0 ; Bootsect. padding | ||
dw 0xaa55 ; Boot sig. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
_putsb: ; Print out a string | ||
lodsb | ||
or al, al | ||
jz .done | ||
|
||
mov ah, 0x0e | ||
int 0x10 | ||
|
||
jmp _putsb | ||
|
||
.done: | ||
ret | ||
disk_read: ; Read 0xff sectors from the disk | ||
mov ah, 2 | ||
mov al, 32 | ||
mov bx, KERNEL | ||
mov ch, 0x00 | ||
mov cl, 0x02 | ||
mov dh, 0x00 | ||
mov dl, [bootd] | ||
|
||
int 0x13 | ||
|
||
jc .fail ; Jump to the fail if error c. present | ||
|
||
ret | ||
|
||
.fail: | ||
mov si, msg_de ; Print out the error msg. | ||
call _putsb | ||
|
||
mov ax, 0x00 | ||
int 0x16 ; Wait for input | ||
int 0x19 ; Reboot | ||
|
||
; Varaibles | ||
bootd: db 0 | ||
KERNEL equ 0x7e00 | ||
msg_de: db "Disk read error occurred",13,10,"Press any key to reboot",0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
NASM := nasm -f bin | ||
|
||
override DUNE := dune.bin | ||
|
||
.PHONY: all | ||
all: $(DUNE) | ||
|
||
$(DUNE): | ||
$(NASM) dune16.nasm -o ../bin/$(DUNE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
;*****************************************************************************; | ||
; /dune/dune16.nasm ; | ||
; ----------------------------------------------------------------------- ; | ||
; Main (16-bit) source file for the DUNE kernel. ; | ||
;*****************************************************************************; | ||
|
||
|
||
org 0x7e00 | ||
bits 16 | ||
jmp _start | ||
|
||
; File includes | ||
%include "i286/stdio.inc" | ||
%include "osh/main16.nasm" | ||
%include "ed/ed.nasm" | ||
|
||
_start: | ||
|
||
mov ax, 0x0003 | ||
int 0x10 | ||
|
||
mov si, msg_2 | ||
call puts16 | ||
|
||
jmp _main_osh | ||
|
||
; Strings | ||
msg_2: db "DUNE kernel v1.00 (for i286) | Running in DOS mode",13,10,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
_main_ed: | ||
mov si, start_msg | ||
call puts16 | ||
|
||
.ed_l: | ||
mov ax, 0x00 | ||
int 0x16 | ||
|
||
cmp al, 0x1b | ||
je .done | ||
|
||
cmp al, 0x08 | ||
je .backpsace | ||
|
||
cmp al, 0x0d | ||
je .return | ||
|
||
mov ah, 0x0e | ||
int 0x10 | ||
jmp .ed_l | ||
|
||
.backpsace: | ||
dec di | ||
mov byte [di], 0 | ||
dec cl | ||
|
||
mov ah, 0x0e | ||
mov al, 0x08 | ||
int 0x10 | ||
|
||
mov al, ' ' | ||
int 0x10 | ||
|
||
mov al, 0x08 | ||
int 0x10 | ||
|
||
jmp .ed_l | ||
|
||
.return: | ||
mov al, 0x00 | ||
stosb | ||
|
||
mov ah, 0x0e | ||
mov al, 0x0d | ||
int 0x10 | ||
|
||
mov al, 0x0a | ||
int 0x10 | ||
|
||
jmp .ed_l | ||
.done: | ||
ret | ||
|
||
cli | ||
hlt | ||
|
||
; Strings | ||
start_msg: db " EDitor v001 | ESC to exit",13,10, 0 |
Oops, something went wrong.