mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 05:18:06 +11:00
Move RC2014 recipe in its own folder
Also, remove `parts/platforms`. It makes no sense. Only recipes make sense.
This commit is contained in:
parent
6597e8a75a
commit
ff99062d5b
@ -1,5 +0,0 @@
|
||||
# platforms
|
||||
|
||||
This is a collection of include files that set platform-specific constants
|
||||
that different parts use. When assembling your own OS, pick the platform include
|
||||
that is closest to yours and adapt it to your machine.
|
@ -1,7 +0,0 @@
|
||||
; classic RC2014 setup (8K ROM + 32K RAM) and a stock Serial I/O module
|
||||
|
||||
; The RAM module is selected on A15, so it has the range 0x8000-0xffff
|
||||
RAMSTART .equ 0x8000
|
||||
RAMEND .equ 0xffff
|
||||
ACIA_CTL .equ 0x80 ; Control and status. RS off.
|
||||
ACIA_IO .equ 0x81 ; Transmit. RS on.
|
@ -37,40 +37,9 @@ device I use in this recipe.
|
||||
* [GNU screen][screen]
|
||||
* A FTDI-to-TTL cable to connect to the Serial I/O module of the RC2014
|
||||
|
||||
### Write main.asm
|
||||
### Write glue.asm
|
||||
|
||||
This is what your glue code would look like:
|
||||
|
||||
```
|
||||
#include "platforms/rc2014.inc"
|
||||
|
||||
jr init
|
||||
|
||||
.fill 0x38-$
|
||||
jp aciaInt
|
||||
|
||||
init:
|
||||
di
|
||||
|
||||
; setup stack
|
||||
ld hl, RAMEND
|
||||
ld sp, hl
|
||||
|
||||
im 1
|
||||
|
||||
call aciaInit
|
||||
call shellInit
|
||||
ei
|
||||
call shellLoop
|
||||
|
||||
#include "core.asm"
|
||||
ACIA_RAMSTART .equ RAMSTART
|
||||
#include "acia.asm"
|
||||
SHELL_RAMSTART .equ ACIA_RAMEND
|
||||
.define SHELL_GETC call aciaGetC
|
||||
.define SHELL_PUTC call aciaPutC
|
||||
#include "shell.asm"
|
||||
```
|
||||
[This is what your glue code would look like.](glue.asm)
|
||||
|
||||
The `platform.inc` include is there to load all platform-specific constants
|
||||
(such as `RAMSTART` and `RAMEND`).
|
||||
@ -99,7 +68,7 @@ is decoupled from the ACIA and can get its IO from anything. See
|
||||
|
||||
We only have the shell to build, so it's rather straightforward:
|
||||
|
||||
scas -I /path/to/parts -o rom.bin main.asm
|
||||
scas -I /path/to/parts -o rom.bin glue.asm
|
||||
|
||||
### Write to the ROM
|
||||
|
33
recipes/rc2014/glue.asm
Normal file
33
recipes/rc2014/glue.asm
Normal file
@ -0,0 +1,33 @@
|
||||
; classic RC2014 setup (8K ROM + 32K RAM) and a stock Serial I/O module
|
||||
; The RAM module is selected on A15, so it has the range 0x8000-0xffff
|
||||
RAMSTART .equ 0x8000
|
||||
RAMEND .equ 0xffff
|
||||
ACIA_CTL .equ 0x80 ; Control and status. RS off.
|
||||
ACIA_IO .equ 0x81 ; Transmit. RS on.
|
||||
|
||||
jr init
|
||||
|
||||
; interrupt hook
|
||||
.fill 0x38-$
|
||||
jp aciaInt
|
||||
|
||||
init:
|
||||
di
|
||||
; setup stack
|
||||
ld hl, RAMEND
|
||||
ld sp, hl
|
||||
im 1
|
||||
call aciaInit
|
||||
call shellInit
|
||||
ei
|
||||
jp shellLoop
|
||||
|
||||
#include "core.asm"
|
||||
ACIA_RAMSTART .equ RAMSTART
|
||||
#include "acia.asm"
|
||||
SHELL_RAMSTART .equ ACIA_RAMEND
|
||||
.define SHELL_GETC call aciaGetC
|
||||
.define SHELL_PUTC call aciaPutC
|
||||
.define SHELL_IO_GETC call aciaGetC
|
||||
SHELL_EXTRA_CMD_COUNT .equ 0
|
||||
#include "shell.asm"
|
Loading…
Reference in New Issue
Block a user