瀏覽代碼

Move SD Card subsystem outside of RC2014 recipe and add protocols

Although the SPI Relay driver is RC2014-specific, the SD Card driver
is generic enough to be a subsystem. That's the second subsystem we
add and this warrants, I think, the formalization of a new concept:
protocols.
master
Virgil Dupras 3 年之前
父節點
當前提交
124da6adec
共有 23 個文件被更改,包括 52 次插入25 次删除
  1. +3
    -2
      blk/001
  2. +5
    -5
      blk/410
  3. +10
    -0
      blk/420
  4. +0
    -0
      blk/423
  5. +0
    -0
      blk/424
  6. +0
    -0
      blk/425
  7. +0
    -0
      blk/426
  8. +0
    -0
      blk/427
  9. +0
    -0
      blk/428
  10. +0
    -0
      blk/429
  11. +0
    -0
      blk/430
  12. +0
    -0
      blk/431
  13. +0
    -0
      blk/432
  14. +0
    -0
      blk/433
  15. +0
    -0
      blk/434
  16. +0
    -0
      blk/435
  17. +1
    -1
      blk/580
  18. +3
    -3
      blk/595
  19. +0
    -0
      blk/599
  20. +0
    -11
      blk/600
  21. +27
    -0
      doc/protocol.txt
  22. +2
    -2
      recipes/rc2014/sdcard/README.md
  23. +1
    -1
      recipes/rc2014/xcomp.fs

+ 3
- 2
blk/001 查看文件

@@ -6,10 +6,11 @@ MASTER INDEX
160-199 unused
200 Z80 assembler 260 Cross compilation
280 Z80 boot code 350 Core words
410 PS/2 keyboard subsystem 420-489 unused
410 PS/2 keyboard subsystem 420 SD Card subsystem
440-489 unused
490 TRS-80 Recipe 520 Fonts
550 TI-84+ Recipe 580 RC2014 Recipe
620 Sega Master System Recipe
600-619 unused 620 Sega Master System Recipe
650 AVR assembler 690-729 unused
730 8086 assembler
800 8086 boot code 830 PC/AT recipe

+ 5
- 5
blk/410 查看文件

@@ -1,10 +1,10 @@
PS/2 keyboard subsystem

Provides (key) from a driver providing (ps2kc). That is, for a
driver taking care of providing all key codes emanating from a
PS/2 keyboard, this subsystem takes care of mapping those key-
strokes to ASCII characters. This code is designed to be cross-
compiled and loaded with drivers.
Provides (key) from a driver providing the PS/2 protocol. That
is, for a driver taking care of providing all key codes emanat-
ing from a PS/2 keyboard, this subsystem takes care of mapping
those keystrokes to ASCII characters. This code is designed to
be cross-compiled and loaded with drivers.

Requires PS2_MEM to be defined.



+ 10
- 0
blk/420 查看文件

@@ -0,0 +1,10 @@
SD Card subsystem

Load range: B423-B436

This subsystem is designed for a ad-hoc adapter card that acts
as a SPI relay between the z80 bus and the SD card. It requires
a driver providing the SPI Relay protocol.

Through that layer, this driver implements the SDC protocol
allowing it to provide BLK@ and BLK!.

blk/603 → blk/423 查看文件


blk/604 → blk/424 查看文件


blk/605 → blk/425 查看文件


blk/606 → blk/426 查看文件


blk/607 → blk/427 查看文件


blk/608 → blk/428 查看文件


blk/609 → blk/429 查看文件


blk/610 → blk/430 查看文件


blk/611 → blk/431 查看文件


blk/612 → blk/432 查看文件


blk/613 → blk/433 查看文件


blk/614 → blk/434 查看文件


blk/615 → blk/435 查看文件


+ 1
- 1
blk/580 查看文件

@@ -5,4 +5,4 @@ ACIA, SD card and AT28 EEPROM.

581 ACIA 586 Zilog SIO driver
592 AT28 EEPROM 595 SPI relay
600 SD card 618 Xcomp unit
599 Xcomp unit

+ 3
- 3
blk/595 查看文件

@@ -1,12 +1,12 @@
SPI relay driver

This driver is designed for a ad-hoc adapter card that acts as a
SPI relay between the z80 bus and the SPI device. Sending any-
SPI relay between the z80 bus and the SPI device. Sending any-
thing on SPI_CSLOW and SPI_CSHIGH is expected to select/deselect
the device, and writing to SPI_DATA is expected to initiate a
the device, and writing to SPI_DATA is expected to initiate a
byte exchange. The result of the exchange is excpected to be re-
trieved by reading SPI_DATA.

Provides (spie) (enable), (spid) (disable), (spix) (xchange).
Provides the SPI relay protocol.

Load driver with "596 LOAD".

blk/618 → blk/599 查看文件


+ 0
- 11
blk/600 查看文件

@@ -1,11 +0,0 @@
SD Card driver

Load range: 603-616

This driver is designed for a ad-hoc adapter card that acts as a
SPI relay between the z80 bus and the SD card. It requires a SPI
driver providing (spix), (spie) and (spid), which oh surprise!
is included in Collapse OS at B595.

Through that layer, this driver implements the SDC protocol
allowing it to provide BLK@ and BLK!.

+ 27
- 0
doc/protocol.txt 查看文件

@@ -0,0 +1,27 @@
# Protocols

Some subsystems (and in the case of KEY and EMIT, the core) re-
quire drivers to implement certain words in a certain way. For
example, the core requires drivers to implement (key) and (emit)
or else it won't know how to provide a console.

These protocols are described here.

# TTY protocol

(key) -- c Returns the next typed key on the console.
If none, block until there is one.
(emit) c -- Spit a character on the console.

# PS/2 protocol

(ps2kc) -- kc Returns the next typed PS/2 keycode from the
console. Blocking.

# SPI Relay protocol

(spie) -- Enable SPI device
(spid) -- Disable SPI device
(spix) n -- n Perform SPI exchange (push a number, get a
number back)

+ 2
- 2
recipes/rc2014/sdcard/README.md 查看文件

@@ -78,10 +78,10 @@ declaring `SPI_DATA`, `SPI_CSLOW` and `SPI_CSHIGH`, which are respectively `4`,
This driver provides `(spix)`, `(spie)` and `(spid)` which are then used in the
SDC driver.

The SDC driver is at B600. It gives you a load range. This means that what
The SDC driver is at B420. It gives you a load range. This means that what
you need to insert in `xcomp` will look like:

603 616 LOADR ( sdc )
423 436 LOADR ( sdc )

You also need to add `BLK$` to the init sequence.



+ 1
- 1
recipes/rc2014/xcomp.fs 查看文件

@@ -1,3 +1,3 @@
618 LOAD
599 LOAD
ORG @ 256 /MOD 2 PC! 2 PC!
H@ 256 /MOD 2 PC! 2 PC!

Loading…
取消
儲存