Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
833b6af
init first boot.img
Oct 2, 2023
beece61
edit and ungitignore .gitignore, delete .bin and .img files
Oct 3, 2023
d66a70f
edit .gitignore
Oct 3, 2023
6e9b6e4
create build bash-scripts
Oct 3, 2023
d6a6f94
edit boot.asm
Oct 3, 2023
8d9d63f
fix od output in ./build_boot
Oct 4, 2023
4aee873
upd rep structure
Oct 4, 2023
bb4dc32
edit rep structure
Oct 4, 2023
059b287
end up "hello world" task
Oct 4, 2023
5fe048f
edit rep structure #3
Oct 5, 2023
81663cf
edit Makefile
Oct 5, 2023
42d04e9
Update Makefile
QQ3646 Oct 5, 2023
0104fe7
add launch.json, tasks.json, rename bochs.linux.conf, edit Makefile
dreamIIx Oct 5, 2023
eb7684f
add bochs config for win & launch option for win
QQ3646 Oct 5, 2023
7449bfe
add win params to makefile
QQ3646 Oct 5, 2023
b4b5aac
separate print.asm, add read_floppy_disk.asm
dreamIIx Oct 5, 2023
24141da
upd .asm files - add square brackets
dreamIIx Oct 5, 2023
62e4e5a
bootloader: fix print data from read floppy disk
dreamIIx Oct 6, 2023
0d4c17f
bootloader: implement accumulate
dreamIIx Oct 6, 2023
12df0e1
separate accumulate sum label
dreamIIx Oct 6, 2023
6e9cd46
bootloader: misc: fix =)
dreamIIx Oct 6, 2023
248f33b
IT DOESN'T WORK! WHY?
dreamIIx Oct 8, 2023
0a5ba2c
delete magic bp hint
dreamIIx Oct 8, 2023
f9b7a27
upd rep structure, add print_d2vm.asm
dreamIIx Oct 9, 2023
e0a5435
env: add win debug config
QQ3646 Oct 12, 2023
187c3cd
bootloader: 384kb read
QQ3646 Oct 12, 2023
cdec383
bootloader: path fix
QQ3646 Oct 12, 2023
9bb2cab
add switch to protected mode
dreamIIx Oct 9, 2023
36224b6
bootloader: delete unnecessary row
dreamIIx Oct 12, 2023
19111f4
bootloader: kernel: build: add kernel entry point
dreamIIx Oct 12, 2023
890d78d
bootloader, kernel: make switch to pm and C
dreamIIx Oct 13, 2023
b2b7838
switch_to_pm: fix
dreamIIx Oct 13, 2023
1b02e86
kernel, makefile: add relative call to main
dreamIIx Oct 13, 2023
e3645d7
kernel: add test for func call in kernel.c
dreamIIx Oct 13, 2023
e7c228d
bootload: comment unnecessary stuff
dreamIIx Oct 13, 2023
0ac7607
clean uneccessary stuff
dreamIIx Oct 20, 2023
bb6ca35
another fix
dreamIIx Oct 20, 2023
75be4f7
floppy: new version
QQ3646 Oct 20, 2023
b11cf9d
floppy: use di instead ds
QQ3646 Oct 20, 2023
0f1d75b
run away from ORG
dreamIIx Oct 23, 2023
0865518
all: fix
QQ3646 Oct 26, 2023
867ddea
upd
dreamIIx Oct 26, 2023
8f406d3
kernel: printf
QQ3646 Nov 3, 2023
a7b0fda
all: practice #4
QQ3646 Nov 7, 2023
a27a4a6
format kernel.c, link ASM label to C code
dreamIIx Nov 8, 2023
c5fd469
upd since passing
dreamIIx Nov 10, 2023
a515f61
printf: review 1
QQ3646 Nov 10, 2023
6416408
Merge branch 'kees/dev' of https://github.com/dreamIIx/unos into kees…
QQ3646 Nov 10, 2023
a4de936
upd
dreamIIx Nov 10, 2023
143459b
printf: review 1
QQ3646 Nov 10, 2023
274bcf1
upd #2
dreamIIx Nov 10, 2023
12b2760
upd (?)
dreamIIx Dec 10, 2023
8f58a19
=)
dreamIIx Dec 24, 2023
df1404e
IDT: first try (without make)
QQ3646 Jan 30, 2024
324279b
here we go
dreamIIx Jan 30, 2024
0cbb298
edit stuff, resolve link problem
dreamIIx Feb 1, 2024
488bce6
renew interruption.hpp
dreamIIx Feb 1, 2024
97145a5
idt: fix printf(0x0), add loop in kernel_panic
QQ3646 Feb 1, 2024
8641745
fix
dreamIIx Feb 1, 2024
2c356bf
add checks on allocation success
dreamIIx Feb 1, 2024
4ac0fc0
little fix
dreamIIx Feb 1, 2024
fcb0ba2
pic
QQ3646 Feb 2, 2024
5e3e11a
context: auto generate tramplins w/ context
QQ3646 Feb 2, 2024
c87c666
make things clean, add context.h
dreamIIx Feb 3, 2024
61dd0b6
make: add flag for windows (remove leading underscores)
QQ3646 Feb 11, 2024
1010c99
fix: fix lab n.6
QQ3646 Feb 11, 2024
da711c1
practice #7
QQ3646 Apr 4, 2024
8318981
some edits
dreamIIx Apr 4, 2024
513d655
ahareravbearb
dreamIIx May 1, 2024
7bc2e03
pizdec a ne code
dreamIIx May 1, 2024
d315bfb
init pdt (ps==0 case)
dreamIIx May 5, 2024
803d332
upd
dreamIIx May 6, 2024
46bf27e
upd 2
dreamIIx May 6, 2024
6e49896
impl pse case, resolves #3
dreamIIx May 9, 2024
3114c6e
temp commit
dreamIIx May 15, 2024
7c708aa
hell
dreamIIx May 18, 2024
65d69c6
purgatory
dreamIIx May 18, 2024
889fb15
purificatory
dreamIIx May 18, 2024
f220001
sync
dreamIIx May 18, 2024
67c4f08
init console
QQ3646 May 18, 2024
849975a
fwevvarverv
dreamIIx May 18, 2024
c13c0e1
console+printer first ver.
QQ3646 May 19, 2024
a77cca0
sync printer
dreamIIx May 19, 2024
098eff9
wtf
dreamIIx May 19, 2024
8c8b98f
blyat
dreamIIx May 19, 2024
a295c43
fix
dreamIIx May 19, 2024
5b92cf3
some fixes, add lockword to scheduler
dreamIIx May 22, 2024
617cc74
fixes
dreamIIx May 22, 2024
fdadd80
upd
dreamIIx May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*
!*.*
!*/

!Makefile

build/*

test.*

!.vscode/
!.vscode/*.*
.vscode/c_cpp_properties.json
.vscode/settings.json
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(linux) bochs floppy",
"type": "f5anything",
"request": "launch",
"command": "bochs -q -f ./bochs.linux.conf",
"preLaunchTask": "make_floppy"
},
{
"name": "(win) bochs floppy",
"type": "f5anything",
"request": "launch",
"command": "& \"${env:BOCHS_PATH}\\bochs\"-q -f ./bochs.win.conf",
"preLaunchTask": "make_floppy"
},
{
"name": "(win_dbg) bochs floppy",
"type": "f5anything",
"request": "launch",
"command": "& \"${env:BOCHS_PATH}\\bochsdbg\" -q -f ./bochsdbg.win.conf",
"preLaunchTask": "make_floppy"
}
]
}
10 changes: 10 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "make_floppy",
"type": "shell",
"command": "./build_"
}
]
}
206 changes: 206 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
SOURCE_DIR = ./src
BUILD_DIR = ./build

BOOTLOADER_SOURCE_DIR = $(SOURCE_DIR)/bootloader
KERNEL_SOURCE_DIR = $(SOURCE_DIR)/kernel
LIBC_SOURCE_DIR = $(SOURCE_DIR)/libc

BOOTLOADER_BUILD_DIR = $(BUILD_DIR)/bootloader
KERNEL_BUILD_DIR = $(BUILD_DIR)/kernel
LIBC_BUILD_DIR = $(BUILD_DIR)/libc

BOOTLOADER_ASM = $(BOOTLOADER_SOURCE_DIR)/boot.asm
KERNEL_C = $(KERNEL_SOURCE_DIR)/kernel.c
KERNEL_ENTRY_ASM = $(KERNEL_SOURCE_DIR)/kernel_entry.asm

TRAMP_WC_O = $(KERNEL_BUILD_DIR)/sys/context/tramplinsWContext.o

BOOTLOADER_BIN = $(BOOTLOADER_BUILD_DIR)/bootloader.bin
KERNEL_O = $(KERNEL_BUILD_DIR)/kernel.o
KERNEL_ENTRY_O = $(KERNEL_BUILD_DIR)/kernel_entry.o
KERNEL_TMP = $(KERNEL_BUILD_DIR)/kernel.tmp
KERNEL_BIN = $(KERNEL_BUILD_DIR)/kernel.bin

FLOPPY_IMG = $(BUILD_DIR)/floppy.img

KERNEL_ENTRY_ADDRESS = 0x20200
# 0xC0020200
# 0x20200

ifeq ($(OS), Windows_NT)
ASM = ${NASM_PATH}\nasm
DD = ${CYGWIN_PATH}\bin\dd
GCC = gcc -fno-leading-underscore
MCOPY =
MKFS =
LD = ld
LD_M_OPT = i386pe
OBJCOPY = objcopy
OD = ${CYGWIN_PATH}\bin\od
OD_OPT = -t x1 -A n
RM =
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
ASM = nasm
GCC = gcc
DD = dd
MCOPY = mcopy
MKFS = mkfs
LD = ld
OBJCOPY = objcopy
OD = od
OD_OPT = -t x1 -A n
RM = rm
endif
endif

$(info init..)

.PHONY: clean_boot floppy kernel bootloader

floppy: bootloader kernel $(FLOPPY_IMG)
kernel: $(KERNEL_BIN)
bootloader: $(BOOTLOADER_BIN)

$(BUILD_DIR)/pm/io/print_d2vm.o: $(SOURCE_DIR)/pm/io/print_d2vm.asm
$(info [MAKE] building: $@)
$(ASM) -f elf $< -o $@

$(TRAMP_WC_O): $(KERNEL_SOURCE_DIR)/sys/context/tramplinsWContext.asm
$(info [MAKE] building: $@)
$(ASM) -f elf $< -o $@

$(KERNEL_BUILD_DIR)/sys/paging/paging.asm.o: $(KERNEL_SOURCE_DIR)/sys/paging/paging.asm
$(info [MAKE] building: $@)
$(ASM) -f elf $< -o $@

$(KERNEL_BUILD_DIR)/sys/process/exec.asm.o: $(KERNEL_SOURCE_DIR)/sys/process/exec.asm
$(info [MAKE] building: $@)
$(ASM) -f elf $< -o $@

$(KERNEL_BUILD_DIR)/sync/sync.asm.o: $(KERNEL_SOURCE_DIR)/sync/sync.asm $(KERNEL_SOURCE_DIR)/sync/sync.h
$(info [MAKE] building: $@)
$(ASM) -f elf $< -o $@

$(KERNEL_BUILD_DIR)/sys/pic/pic.o: $(KERNEL_SOURCE_DIR)/sys/pic/pic.c \
$(KERNEL_SOURCE_DIR)/sys/pic/pic.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/sys/io/printf.o: $(KERNEL_SOURCE_DIR)/sys/io/printf.c \
$(KERNEL_SOURCE_DIR)/sys/io/printf.h $(KERNEL_SOURCE_DIR)/sync/sync.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/sys/memory/mem_utils.o: $(KERNEL_SOURCE_DIR)/sys/memory/mem_utils.c \
$(KERNEL_SOURCE_DIR)/sys/memory/mem_utils.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/sys/memory/alloc.o: $(KERNEL_SOURCE_DIR)/sys/memory/alloc.c \
$(KERNEL_SOURCE_DIR)/sys/memory/alloc.h $(KERNEL_SOURCE_DIR)/sys/paging/paging.h \
$(KERNEL_SOURCE_DIR)/sys/io/io.h $(KERNEL_SOURCE_DIR)/sys/io/printf.h \
$(KERNEL_SOURCE_DIR)/misc/list.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/sys/context/exp.o: $(KERNEL_SOURCE_DIR)/sys/context/experiment.asm
$(info [MAKE] building: $@)
$(ASM) -f elf $< -o $@

$(KERNEL_BUILD_DIR)/sys/paging/paging.o: $(KERNEL_SOURCE_DIR)/sys/paging/paging.c \
$(KERNEL_SOURCE_DIR)/sys/paging/paging.h $(KERNEL_SOURCE_DIR)/sys/memory/alloc.h \
$(KERNEL_SOURCE_DIR)/sys/paging/pdt.h $(KERNEL_SOURCE_DIR)/sys/paging/pt.h \
$(KERNEL_SOURCE_DIR)/sys/io/io.h $(KERNEL_SOURCE_DIR)/sys/io/printf.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/misc/list.o: $(KERNEL_SOURCE_DIR)/misc/list.c \
$(KERNEL_SOURCE_DIR)/misc/list.h $(KERNEL_SOURCE_DIR)/sys/memory/alloc.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/sys/process/process.o: $(KERNEL_SOURCE_DIR)/sys/process/process.c \
$(KERNEL_SOURCE_DIR)/sys/process/process.h $(KERNEL_SOURCE_DIR)/sys/paging/paging.h \
$(KERNEL_SOURCE_DIR)/sys/io/io.h $(KERNEL_SOURCE_DIR)/sys/io/printf.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/sys/process/scheduler.o: $(KERNEL_SOURCE_DIR)/sys/process/scheduler.c \
$(KERNEL_SOURCE_DIR)/sys/process/scheduler.h $(KERNEL_SOURCE_DIR)/misc/list.h \
$(KERNEL_SOURCE_DIR)/sys/memory/alloc.h $(KERNEL_SOURCE_DIR)/sys/context/context.h \
$(KERNEL_SOURCE_DIR)/sys/process/process.h $(KERNEL_SOURCE_DIR)/sys/paging/paging.h \
$(LIBC_SOURCE_DIR)/io/console.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_BUILD_DIR)/sys/interruption.o: $(KERNEL_SOURCE_DIR)/sys/interruption.c \
$(KERNEL_SOURCE_DIR)/sys/interruption.h $(KERNEL_SOURCE_DIR)/sys/tramplins.hpp \
$(KERNEL_SOURCE_DIR)/sys/context/tramplinsWContext.asm \
$(KERNEL_SOURCE_DIR)/sys/context/context.h $(KERNEL_SOURCE_DIR)/sys/io/io.h $(KERNEL_SOURCE_DIR)/sys/io/printf.h \
$(KERNEL_SOURCE_DIR)/sys/memory/memory.h $(KERNEL_SOURCE_DIR)/sys/paging/paging.h $(KERNEL_SOURCE_DIR)/sys/pic/pic.h \
$(KERNEL_SOURCE_DIR)/sys/process/scheduler.h $(KERNEL_SOURCE_DIR)/sync/sync.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(LIBC_BUILD_DIR)/io/console.o: $(LIBC_SOURCE_DIR)/io/console.c $(LIBC_SOURCE_DIR)/io/console.h \
$(KERNEL_SOURCE_DIR)/sys/io/io.h $(KERNEL_SOURCE_DIR)/sys/memory/alloc.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(LIBC_BUILD_DIR)/io/printer.o: $(LIBC_SOURCE_DIR)/io/printer.c $(LIBC_SOURCE_DIR)/io/printer.h \
$(KERNEL_SOURCE_DIR)/sys/io/io.h $(KERNEL_SOURCE_DIR)/sys/memory/alloc.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@

$(KERNEL_O): $(KERNEL_C) $(KERNEL_SOURCE_DIR)/sys/io/io.h $(KERNEL_SOURCE_DIR)/sys/io/printf.h \
$(KERNEL_SOURCE_DIR)/sys/memory/memory.h $(KERNEL_SOURCE_DIR)/sys/interruption.h \
$(KERNEL_SOURCE_DIR)/sys/pic/pic.h $(KERNEL_SOURCE_DIR)/sys/paging/paging.h \
$(KERNEL_SOURCE_DIR)/sys/process/scheduler.h $(LIBC_SOURCE_DIR)/io/printer.h
$(info [MAKE] building: $@)
$(GCC) -Wall -m32 -mno-sse -fno-pie -ffreestanding -nostdlib -fno-stack-protector -c $< -o $@
# -m32

$(KERNEL_ENTRY_O): $(KERNEL_ENTRY_ASM)
$(info [MAKE] building: $@)
$(ASM) -f elf $< -o $@

$(KERNEL_BIN): $(KERNEL_ENTRY_O) $(KERNEL_O) \
$(KERNEL_BUILD_DIR)/sys/io/printf.o $(BUILD_DIR)/pm/io/print_d2vm.o $(KERNEL_BUILD_DIR)/sys/memory/alloc.o \
$(KERNEL_BUILD_DIR)/sys/interruption.o $(KERNEL_BUILD_DIR)/sys/memory/mem_utils.o $(KERNEL_BUILD_DIR)/sys/pic/pic.o \
$(TRAMP_WC_O) $(KERNEL_BUILD_DIR)/sys/context/exp.o \
$(KERNEL_BUILD_DIR)/sys/paging/paging.asm.o $(KERNEL_BUILD_DIR)/sys/paging/paging.o $(KERNEL_BUILD_DIR)/misc/list.o \
$(KERNEL_BUILD_DIR)/sys/process/process.o $(KERNEL_BUILD_DIR)/sys/process/scheduler.o \
$(KERNEL_BUILD_DIR)/sys/process/exec.asm.o $(KERNEL_BUILD_DIR)/sync/sync.asm.o $(LIBC_BUILD_DIR)/io/console.o \
$(LIBC_BUILD_DIR)/io/printer.o
$(info [MAKE] building: $@)
$(LD) -m i386pe -Ttext $(KERNEL_ENTRY_ADDRESS) $^ -o $(KERNEL_TMP)
# $(LD) -m i386pe -T $(KERNEL_SOURCE_DIR)/link.ld $^ -o $(KERNEL_TMP)
# $(KERNEL_TMP)
$(OBJCOPY) -I pe-i386 -O binary $(KERNEL_TMP) $@

$(BOOTLOADER_BIN): $(BOOTLOADER_ASM) $(SOURCE_DIR)/rm/io/print.asm \
$(SOURCE_DIR)/bootloader/read_floppy_disk.asm $(SOURCE_DIR)/pm/switch2pm.asm \
$(SOURCE_DIR)/pm/gdt.asm $(SOURCE_DIR)/pm/io/print_d2vm.asm
$(info [MAKE] building: $@)
$(ASM) -fbin $< -o $@
$(OD) $(OD_OPT) $@

$(FLOPPY_IMG): $(BOOTLOADER_BIN) $(KERNEL_BIN)
$(info [MAKE] building: $@)
$(DD) bs=512 count=2880 if=/dev/zero of=$@
# $(MKFS) -t fat -F 12 -n "UNOS" $@
$(DD) conv=notrunc if=$< of=$@
# $(MCOPY) -i $@ $(word 2,$^) "::kernel.bin"
$(DD) conv=notrunc seek=1 if=$(word 2,$^) of=$@

clean_boot:
$(info [MAKE] do $@:)
$(RM) -f $(FLOPPY_IMG)
$(RM) -f $(KERNEL_ENTRY_O)
$(RM) -f $(KERNEL_O)
$(RM) -f $(KERNEL_TMP)
$(RM) -f $(KERNEL_BIN)
$(RM) -f $(BOOTLOADER_BIN)
$(RM) -f $(BOOTLOADER_BIN)
8 changes: 8 additions & 0 deletions bochs.linux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugin_ctrl: unmapped=true, biosdev=true, speaker=true, extfpuirq=true, parallel=true, serial=true
config_interface: textconfig
display_library: x, options="gui_debug"
memory: host=2048, guest=4096
boot: floppy
floppy_bootsig_check: disabled=0
floppya: type=1_44, 1_44="./build/floppy.img", status=inserted, write_protected=0
magic_break: enabled=1
8 changes: 8 additions & 0 deletions bochs.win.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugin_ctrl: unmapped=true, biosdev=true, speaker=true, extfpuirq=true, parallel=true, serial=true
config_interface: win32config
display_library: win32
memory: host=2048, guest=4096
boot: floppy
floppy_bootsig_check: disabled=0
floppya: type=1_44, 1_44="./build/floppy.img", status=inserted, write_protected=0
magic_break: enabled=1
8 changes: 8 additions & 0 deletions bochsdbg.win.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugin_ctrl: unmapped=true, biosdev=true, speaker=true, extfpuirq=true, parallel=true, serial=true
config_interface: win32config
display_library: win32, options="gui_debug"
memory: host=2048, guest=4096
boot: floppy
floppy_bootsig_check: disabled=0
floppya: type=1_44, 1_44="./build/floppy.img", status=inserted, write_protected=0
magic_break: enabled=1
26 changes: 26 additions & 0 deletions bx_enh_dbg.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# bx_enh_dbg_ini
SeeReg[0] = TRUE
SeeReg[1] = TRUE
SeeReg[2] = TRUE
SeeReg[3] = TRUE
SeeReg[4] = FALSE
SeeReg[5] = FALSE
SeeReg[6] = TRUE
SeeReg[7] = FALSE
SingleCPU = FALSE
ShowIOWindows = TRUE
ShowButtons = TRUE
SeeRegColors = TRUE
ignoreNxtT = TRUE
ignSSDisasm = TRUE
UprCase = 0
DumpInAsciiMode = 3
isLittleEndian = TRUE
DefaultAsmLines = 512
DumpWSIndex = 0
DockOrder = 0x123
ListWidthPix[0] = 381
ListWidthPix[1] = 468
ListWidthPix[2] = 466
MainWindow = 0, 0, 878, 500
FontName = Normal
66 changes: 66 additions & 0 deletions src/bootloader/boot.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[BITS 16]

KERNEL_OFFSET_ES equ 0x2000
KERNEL_OFFSET_BX equ 0

main:
xor ax, ax
mov es, ax

cli
mov ss, ax
mov sp, 0x7c00
mov ax, 0x7c0
mov ds, ax
mov bp, 0x7c00

mov si, os_boot_msg
call print

mov ax, KERNEL_OFFSET_ES
mov es, ax
mov bx, KERNEL_OFFSET_BX
call disk_load

;mov si, KERNEL_OFFSET_ES
;xor cx, cx
;mov al, dh
;mov cx, 0x200
;mul cx
;mov cx, ax
;add cx, 0
;xor ah, ah
;call accumulate

;mov si, sum
;call print ; TODO: implement print_hex, source=?

call switch_to_pm

jmp $

%ifndef PRINT
%include "./src/rm/io/print.asm"
%endif

;%ifndef PRINT_HEX
; %include "./src/rm/io/print_hex.asm"
;%endif

%ifndef READ_FLOPPY_DISK
%include "./src/bootloader/read_floppy_disk.asm"
%endif

;%ifndef ACCUMULATE_SUM
; %include "./src/rm/misc/accumulate_sum.asm"
;%endif

os_boot_msg:
DB 'Hello world!', 0x0d, 0x0a, 0

%ifndef SWITCH_TO_PM
%include "./src/pm/switch2pm.asm"
%endif

times 510-($-$$) DB 0
dw 0xaa55
Loading