diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index b0b5d5b..91de722 --- a/Makefile +++ b/Makefile @@ -5,18 +5,14 @@ TARGET := sentinel-65x-512K .PHONY: all all: build/$(TARGET).bin -include config/boot.mk include config/kernel.mk -build/$(TARGET).bin: build/boot.bin build/kernel.bin +build/$(TARGET).bin: build/kernel.bin #Create an empty .bin file. @dd if=/dev/zero of=$@ bs=1024 count=512 -# Add the boot module at offset 0x008000 - @dd if=build/boot.bin of=$@ bs=1024 seek=32 conv=notrunc - -# Add the bios module at offset 0x008300 - @dd if=build/kernel.bin of=$@ bs=1 seek=33536 conv=notrunc +# Add the bios module at offset 0x000000 + @dd if=build/kernel.bin of=$@ conv=notrunc .PHONY: clean clean: @@ -32,5 +28,5 @@ clean: \) -delete .PHONY: flash -flash: $(TARGET).bin +flash: build/$(TARGET).bin $(MP) $(MPFLAGS) -w $< diff --git a/config/boot.mk b/config/boot.mk deleted file mode 100644 index 881cb88..0000000 --- a/config/boot.mk +++ /dev/null @@ -1,10 +0,0 @@ -BOOT_SRC := $(wildcard src/boot/*.s) - -BOOT_OBJ := $(BOOT_SRC:.s=.o) - -BOOT_LDFLAGS := --list-file build/boot.lst - -build/boot.bin: $(BOOT_OBJ) - @echo "Linking $@..." - @$(LD) -o $@ config/boot.scm $(LDFLAGS) $(BOOT_LDFLAGS) $^ - @mv build/boot.raw $@ \ No newline at end of file diff --git a/config/boot.scm b/config/boot.scm deleted file mode 100644 index 0880d47..0000000 --- a/config/boot.scm +++ /dev/null @@ -1,36 +0,0 @@ -(define memories '( - - (memory Code - (address (#x008000 . #x0080FF)) - (section code) - (section cdata) - (section switch) - ) - - (memory Data - (address (#x008100 . #x0081FF)) - (section near) - (section data) - (section znear) - (section zdata) - ) - - (memory Stack - (address (#x000100 . #x0001FF)) - (section (stack #x00100)) - ) - - (memory DirectPage - (address (#x000000 . #x0000FF)) - (section - (registers #x000004) - (ztiny) - ) - ) - - (block stack (size #x100)) ; machine stack size - - (base-address _DirectPageStart DirectPage 0) - - (base-address _NearBaseAddress Data 0) -)) diff --git a/config/config.mk b/config/config.mk old mode 100644 new mode 100755 diff --git a/config/kernel.mk b/config/kernel.mk old mode 100644 new mode 100755 diff --git a/config/kernel.scm b/config/kernel.scm old mode 100644 new mode 100755 index bbc6020..0b39f6c --- a/config/kernel.scm +++ b/config/kernel.scm @@ -9,8 +9,15 @@ (section heap) ) + (memory BOOT + (address (#x008000 . #x0082FF)) + (scatter-to boot_rom) + (section boot) + ) + (memory ROM - (address (#xC08300 . #xC0FFFF)) + (address (#xC00000 . #xC0FFFF)) + (section (boot_rom #xC08000)) (section (code #xC08300)) (section farcode) (section cdata) @@ -41,5 +48,5 @@ (base-address _DirectPageStart DirectPage 0) - (base-address _NearBaseAddress ROM 0) + (base-address _NearBaseAddress RAM #x00) )) diff --git a/doc/syscalls.md b/doc/syscalls.md old mode 100644 new mode 100755 index 54d748b..90d441f --- a/doc/syscalls.md +++ b/doc/syscalls.md @@ -341,8 +341,8 @@ Arguments: Return value: - `C`: Status code - - `X`: New file position (`31:16`) - - `Y`: New file position (`15:0`) + - `X`: New file position (Low word) + - `Y`: New file position (High word) This call moves the internal file pointer, the position in the specified file from which data can be read or to which data can be written. On success, this call returns diff --git a/include/.DS_Store b/include/.DS_Store old mode 100644 new mode 100755 diff --git a/include/65c816.h b/include/65c816.h old mode 100644 new mode 100755 diff --git a/include/config.h b/include/config.h old mode 100644 new mode 100755 diff --git a/include/kernel/device.h b/include/kernel/device.h old mode 100644 new mode 100755 diff --git a/include/kernel/device/null.h b/include/kernel/device/null.h old mode 100644 new mode 100755 diff --git a/include/kernel/file.h b/include/kernel/file.h old mode 100644 new mode 100755 index b6bfbef..bb98f32 --- a/include/kernel/file.h +++ b/include/kernel/file.h @@ -44,8 +44,8 @@ struct file { uint8_t minor_number; }; -// Using the pathname in the provided FCB, identify the device which manages -// the file and have that device populate the FCB. +// Using the pathname in the provided file stucture, identify the device which manages +// the file and have that device populate the file structure. int file_init(char *pathname, struct file *file); int file_open(struct file *file); diff --git a/include/macros.h b/include/macros.h old mode 100644 new mode 100755 diff --git a/include/sentinel65x.h b/include/sentinel65x.h old mode 100644 new mode 100755 diff --git a/include/vera.h b/include/vera.h old mode 100644 new mode 100755 diff --git a/include/w65c265s.h b/include/w65c265s.h old mode 100644 new mode 100755 diff --git a/license.md b/license.md old mode 100644 new mode 100755 diff --git a/readme.md b/readme.md old mode 100644 new mode 100755 diff --git a/src/.DS_Store b/src/.DS_Store old mode 100644 new mode 100755 diff --git a/src/boot/boot.s b/src/kernel/boot.s old mode 100644 new mode 100755 similarity index 79% rename from src/boot/boot.s rename to src/kernel/boot.s index 50dab2f..92d4398 --- a/src/boot/boot.s +++ b/src/kernel/boot.s @@ -3,13 +3,11 @@ //; boot/boot.s //; Boot code for Sentinel 65X //; -//; Copyright © 2024 Kyle J Cardoza +//; Copyright � 2024 Kyle J Cardoza #include "sentinel65x.h" - .section code, noreorder - .pubweak __program_root_section -__program_root_section: + .section boot, noreorder .asciz "WDC" w65c265s_init: // Disable interrupts @@ -49,5 +47,11 @@ delay_y lda #0b11110011 sta PCS7 + // Disable the on-CPU ROM + w65c265s_rom_off + + // Disable the on-CPU RAM + w65c265s_sram_off + // And we are booted enough to jump to high ROM. jmp long:0xC08300 \ No newline at end of file diff --git a/src/kernel/cstartup.s b/src/kernel/cstartup.s old mode 100644 new mode 100755 diff --git a/src/kernel/device.c b/src/kernel/device.c old mode 100644 new mode 100755 diff --git a/src/kernel/device/null.c b/src/kernel/device/null.c old mode 100644 new mode 100755 diff --git a/src/kernel/file.c b/src/kernel/file.c old mode 100644 new mode 100755 diff --git a/src/kernel/irq.c b/src/kernel/irq.c old mode 100644 new mode 100755 diff --git a/src/kernel/irq_trampoline.s b/src/kernel/irq_trampoline.s old mode 100644 new mode 100755 diff --git a/src/kernel/main.c b/src/kernel/main.c old mode 100644 new mode 100755 diff --git a/src/kernel/stubs.c b/src/kernel/stubs.c old mode 100644 new mode 100755 diff --git a/src/kernel/vera_font_0.ase b/src/kernel/vera_font_0.ase old mode 100644 new mode 100755