-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
61 changed files
with
318 additions
and
2,516 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -23,3 +23,4 @@ a.out | |
*.old | ||
/bx_enh_dbg.ini | ||
bochsrc.bxrc | ||
/tmp |
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,31 +1,32 @@ | ||
.DEFAULT_GOAL := all | ||
TOPDIR := $(CURDIR) | ||
export TOPDIR | ||
TOPDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
SYSROOTDIR := $(TOPDIR)/sysroot | ||
TOOLSDIR := $(TOPDIR)/tools | ||
|
||
SUBDIR := thirdparty lib bin kernel | ||
RM = echo | ||
|
||
CLEANFILES += stupid.iso stupid.tar.gz | ||
SUBDIRS := kernel lib bin | ||
|
||
.PHONY: docs | ||
docs: | ||
-mkdir -p docs/html | ||
naturaldocs -p docs/config -img docs/img -xi tmp -i . -o HTML docs/html | ||
cp docs/img/favicon.ico docs/html/ | ||
TARGET = stupid.iso stupid.tar.gz | ||
|
||
.PHONY: all | ||
all: $(TARGET) | ||
|
||
GOAL:=install | ||
clean: GOAL:=clean | ||
|
||
.PHONY: $(SUBDIRS) | ||
$(SUBDIRS): | ||
@echo "📁 $@" | ||
DESTDIR=$(SYSROOTDIR) $(MAKE) -C $@ $(GOAL) | ||
|
||
.PHONY: stupid.iso | ||
stupid.iso: | ||
$(MAKE) all | ||
DESTDIR=$(TOPDIR)/sysroot $(MAKE) install | ||
stupid.iso: $(SUBDIRS) | ||
$(TOPDIR)/tools/create-iso $@ sysroot | ||
|
||
.PHONY: stupid.tar.gz | ||
stupid.tar.gz: | ||
$(MAKE) all | ||
DESTDIR=$(TOPDIR)/sysroot $(MAKE) install | ||
stupid.tar.gz: $(SUBDIRS) | ||
tar -czvf $@ sysroot | ||
|
||
run: stupid.iso | ||
qemu-system-i386 -cdrom $< -serial stdio | ||
|
||
include $(TOPDIR)/share/mk/stupid.subdir.mk | ||
include $(TOPDIR)/share/mk/stupid.clean.mk | ||
.PHONY: clean | ||
clean: $(SUBDIRS) | ||
$(RM) $(TARGET) $(SYSROOTDIR) |
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,3 +1,11 @@ | ||
NOSUBDIR := 1 | ||
SUBDIRS = cmd | ||
|
||
include $(TOPDIR)/share/mk/stupid.subdir.mk | ||
TOPGOALS = all clean install | ||
|
||
.PHONY: $(SUBDIRS) | ||
$(SUBDIRS): | ||
@echo "📁 bin/$@" | ||
DESTDIR=$(DESTDIR)/bin $(MAKE) -C $@ $(MAKECMDGOALS) | ||
|
||
.PHONY: $(TOPGOALS) | ||
$(TOPGOALS): $(SUBDIRS) |
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,5 @@ | ||
all: | ||
|
||
clean: | ||
|
||
install: |
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,6 @@ | ||
builtins: | ||
db 2, 'cd' | ||
db 1, '.' | ||
db 3, 'set' | ||
db 5, 'unset' | ||
db 4, 'exit' |
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,8 @@ | ||
format ELF | ||
entry start | ||
|
||
include 'builtins.inc' | ||
|
||
start: | ||
|
||
int 0x2A |
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
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,17 +1,27 @@ | ||
AS = fasm | ||
RM = rm -f | ||
INSTALL = install | ||
|
||
KERNEL = vmstupid | ||
SRCS = kernel.asm \ | ||
const.inc \ | ||
boot/multiboot.inc \ | ||
boot/boot.inc \ | ||
mm/mm.inc | ||
|
||
.PHONY: all | ||
all: $(KERNEL) | ||
|
||
$(KERNEL): $(SRCS) | ||
$(AS) kernel.asm $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
$(RM) $(KERNEL) | ||
|
||
SRCS = boot/head.s \ | ||
boot/gdt.s \ | ||
boot/idt.s \ | ||
boot/isr.s \ | ||
boot/tss.s \ | ||
kernel.s \ | ||
lib/log.s dev/at/serial.s \ | ||
i18n/msg_en.s | ||
INCS = sys/multiboot.inc \ | ||
sys/i386/cpuid.inc \ | ||
sys/i386/mmu.inc \ | ||
sys/i386/registers.inc | ||
.PHONY: install | ||
install: $(KERNEL) | ||
@ mkdir -p $(DESTDIR) | ||
install $< $(DESTDIR) | ||
|
||
include $(TOPDIR)/share/mk/stupid.kernel.mk | ||
#include $(TOPDIR)/share/mk/stupid.inc.mk | ||
.PHONY: all clean |
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,35 @@ | ||
ORG 0x100000 | ||
ALIGN 4 | ||
USE32 | ||
|
||
INCLUDE 'boot/multiboot.inc' | ||
INCLUDE 'const.inc' | ||
|
||
mb_header MultibootHeader MB_FLAGS, mb_header, VIDEO_WIDTH, VIDEO_HEIGHT, VIDEO_DEPTH | ||
|
||
_start: | ||
cli | ||
cmp eax, MULTIBOOT_MAGIC | ||
jne hang | ||
|
||
; iterate over memory | ||
|
||
; | ||
|
||
; | ||
xor esi, esi | ||
mov edi, kernel_page_table - KBASE | ||
|
||
mov ecx, kernel_page_directory - KBASE | ||
mov cr3, ecx | ||
|
||
mov ecx, cr0 | ||
|
||
|
||
hang: | ||
hlt | ||
jmp $-1 | ||
|
||
; SEGMENT readable writable | ||
|
||
boot_struct dd 0x0 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.