Combined boot and kernel modules into one
This commit is contained in:
parent
6d4a8f4e2b
commit
588ad3f1b2
|
@ -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 $<
|
||||
|
|
|
@ -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 $@
|
|
@ -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)
|
||||
))
|
|
@ -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)
|
||||
))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -3,13 +3,11 @@
|
|||
//; boot/boot.s
|
||||
//; Boot code for Sentinel 65X
|
||||
//;
|
||||
//; Copyright © 2024 Kyle J Cardoza <Kyle.Cardoza@icloud.com>
|
||||
//; Copyright <EFBFBD> 2024 Kyle J Cardoza <Kyle.Cardoza@icloud.com>
|
||||
|
||||
#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
|
Loading…
Reference in New Issue