-
-
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.
feat(bootload): load next stage and preload kernel from FAT
- Loading branch information
Showing
10 changed files
with
590 additions
and
363 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
TOPDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
SYSROOTDIR := $(TOPDIR)/sysroot | ||
TOOLSDIR := $(TOPDIR)/tools | ||
|
||
RM = echo | ||
|
||
SUBDIRS := boot kernel lib bin | ||
|
||
TARGET = stupid.tar.gz floppy_boot.img | ||
ifneq ($(OS),Windows_NT) | ||
TARGET += stupid.iso | ||
endif | ||
|
||
.PHONY: all | ||
all: $(TARGET) | ||
|
||
GOAL:=install | ||
clean: GOAL:=clean | ||
|
||
.PHONY: $(SUBDIRS) | ||
$(SUBDIRS): | ||
@echo "📁 $@" | ||
DESTDIR=$(SYSROOTDIR) $(MAKE) -C $@ $(GOAL) | ||
|
||
.PHONY: stupid.iso | ||
stupid.iso: $(SUBDIRS) | ||
$(TOPDIR)/tools/create-iso $@ sysroot | ||
|
||
.PHONY: stupid.tar.gz | ||
stupid.tar.gz: $(SUBDIRS) | ||
tar -czvf $@ sysroot | ||
|
||
.PHONY: floppy_boot.img | ||
floppy_boot.img: | ||
@ echo | ||
|
||
.PHONY: clean | ||
clean: $(SUBDIRS) | ||
TOPDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
SYSROOTDIR := $(TOPDIR)/sysroot | ||
TOOLSDIR := $(TOPDIR)/tools | ||
|
||
RM = echo | ||
|
||
SUBDIRS := boot kernel lib bin | ||
|
||
TARGET = stupid.tar.gz floppy_boot.img | ||
ifneq ($(OS),Windows_NT) | ||
TARGET += stupid.iso | ||
endif | ||
|
||
.PHONY: all | ||
all: $(TARGET) | ||
|
||
GOAL:=install | ||
clean: GOAL:=clean | ||
|
||
.PHONY: $(SUBDIRS) | ||
$(SUBDIRS): | ||
@echo "📁 $@" | ||
DESTDIR=$(SYSROOTDIR) $(MAKE) -C $@ $(GOAL) | ||
|
||
.PHONY: stupid.iso | ||
stupid.iso: $(SUBDIRS) | ||
$(TOPDIR)/tools/create-iso $@ sysroot | ||
|
||
.PHONY: stupid.tar.gz | ||
stupid.tar.gz: $(SUBDIRS) | ||
tar -czvf $@ sysroot | ||
|
||
.PHONY: floppy_boot.img | ||
floppy_boot.img: | ||
dd if=/dev/zero of=$@ bs=512 count=1440 | ||
mformat -C -f 1440 -i $@ | ||
dd if=boot/bootsector.bin of=$@ conv=notrunc | ||
mcopy -i $@ boot/stpdboot.sys ::/STPDBOOT.SYS | ||
mcopy -i $@ kernel/vmstupid ::/VMSTUPID.SYS | ||
|
||
.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,22 +1,29 @@ | ||
AS = fasm | ||
RM = rm | ||
|
||
TARGET = bootcode.bin | ||
|
||
SRCS = boot.asm \ | ||
const.inc \ | ||
a20.inc | ||
|
||
.PHONY: all | ||
all: $(TARGET) | ||
|
||
$(TARGET): $(SRCS) | ||
$(AS) boot.asm $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
$(RM) $(TARGET) | ||
|
||
.PHONY: install | ||
install: $(TARGET) | ||
@ mkdir -p $(DESTDIR) | ||
AS = fasm | ||
RM = rm | ||
|
||
TARGET = bootsector.bin stpdboot.sys | ||
|
||
STAGE0_SRCS = boot0.asm \ | ||
const.inc \ | ||
fat12.inc | ||
|
||
STAGE1_SRCS = boot1.asm \ | ||
const.inc \ | ||
a20.inc | ||
|
||
.PHONY: all | ||
all: $(TARGET) | ||
|
||
bootsector.bin: $(STAGE0_SRCS) | ||
$(AS) boot0.asm $@ | ||
|
||
stpdboot.sys: $(STAGE1_SRCS) | ||
$(AS) boot1.asm $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
$(RM) $(TARGET) | ||
|
||
.PHONY: install | ||
install: $(TARGET) | ||
@ mkdir -p $(DESTDIR) |
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,2 @@ | ||
#+TITLE: StupidOS Bootloader | ||
|
Oops, something went wrong.