|
|
2 giorni fa | |
|---|---|---|
| .. | ||
| README.md | 3 giorni fa | |
| build.bat | 3 giorni fa | |
| build_all.bat | 2 giorni fa | |
| build_vim.bat | 2 giorni fa | |
| kernal_os.asm | 2 giorni fa | |
| kernal_os.cfg | 3 giorni fa | |
| kernal_os.d64 | 2 giorni fa | |
| kernal_os.o | 2 giorni fa | |
| kernal_os.prg | 2 giorni fa | |
| run.bat | 2 giorni fa | |
| vim.asm | 2 giorni fa | |
| vim.cfg | 2 giorni fa | |
| vim.o | 2 giorni fa | |
| vim.prg | 2 giorni fa | |
This sample shows a practical starting memory layout for a Commodore 64 OS that keeps the KERNAL ROM visible so you can continue using routines like CINT, BSOUT, GETIN, LOAD, and SAVE.
Use $0001 with low bits %110:
LORAM = 0HIRAM = 1CHAREN = 1That gives you:
$A000-$BFFF = RAM under BASIC ROM$C000-$CFFF = always-visible RAM for your OS core$D000-$DFFF = I/O visible$E000-$FFFF = KERNAL ROM visibleIn practice, the commonly seen value is $36, but this sample preserves the upper cassette-control bits and only changes the low three banking bits.
$0002, $00FB-$00FE = fast zero-page workspace$0200-$03FF = vectors, buffers, light system workspace$0400-$07E7 = screen RAM$0801-$9FFF = BASIC area during development, or additional RAM if you fully replace BASIC usage$A000-$BFFF = banked work RAM, modules, command buffers, filesystem workspace$C000-$CFFF = OS core and resident code$E000-$FFFF = KERNAL ROM, still callable through $FFxxIt lets you:
$A000-$BFFF$C000$0801 as a normal BASIC-start PRG10 SYS2061$A000 and a small signature starting at $A001$A100 for simple shell LOAD/SAVE operations$A000build.bat
Because this program now starts in normal BASIC memory at $0801, load and run it like a standard BASIC program:
LOAD "KERNAL_OS.PRG",8
RUN
If you want to jump into it manually after loading, the BASIC stub runs:
SYS 2061
If you are in VICE:
x64sc -autostart kernal_os.prg
Then use these CLI commands:
HELP to show the command listMEM to show $0001 and the live work byte at $A000INC to increment the work byte at $A000DUMP to show $A000-$A00FZERO to clear the first 16 bytes of the workspaceSIGN to rewrite the signature starting at $A001SCREEN to show the current C64 screen dimensions from the KERNALDIR to list only the filenames on the current targetSTATUS to read and print the drive status channel on the current targetINIT to send the standard I initialize command to the current targetECHO text to print text and load the shell buffer at $A100TOUCH filename to create an empty sequential fileTYPE filename to print a sequential file from the current targetLOAD filename to load a sequential file into the shell buffer at $A100SAVE filename to save the current shell buffer from $A100DEVICE n or DEV n to set the current device number, usually 8-15DRIVE n to set the current drive number, usually 0 or 1DEL filename to scratch a file on the current targetERASE filename as an alias for DELCLS to clear the screenABOUT to reprint the layout explanationEXIT to restore normal memory mapping and return to BASICTYPE, LOAD, and SAVE are implemented as sequential-file shell commandsLOAD filename in this sample does not replace the running OS core with a machine-language PRG$A100SAVE filename writes the current buffer back out as a sequential fileTOUCH filename creates an empty sequential file by opening it for write and closing it immediatelyECHO text also fills the $A100 shell buffer so it can be savedThe shell now supports a simple redirection pattern for ECHO:
ECHO HELLO WORLD > SAVE TESTFILE
That:
HELLO WORLD into the shell buffer at $A100SAVE TESTFILEThis is intentionally small and predictable rather than a full Unix-style pipe system.
That keeps the sample safe and predictable while still showing how a KERNAL-based OS shell can manage files and a current DOS target.
Powered by TurnKey Linux.