Proposal for the 8K IP64 ROM: 1) Implement IPv4 (maybe ipv6 someday.. hard to handle those addresses on 8 bits tho) 2) Use device 7 as interface. 3) No TCP option headers are parsed and will be skipped over. Memory map (Preliminary) - All values are little endian except for IP address or otherwise specified. Address Size Description ------- ---- ----------- === Configuration === $02A8 4 IP address (0.1.2.3) $02AC 4 Netmask (0.1.2.3) $02B0 4 Gateway (0.1.2.3) $02B4 4 DNS (0.1.2.3) $02B8 4 TFTP address (0.1.2.3) $02BC 2 TFTP port $02BE 2 MTU (>1500 not allowed), and flags 15: Get config from DHCP 14: Autoboot from TFTP (Will attempt to load "BOOT" from TFTP and run it, should be BASIC prog) 13-11: Reserved (0) 10-0: MTU/MRU $02C0 6 MAC address === Pointers === $02C8 2 Pointer to packet buffer SEND (Default: $E000, under kernel, 1536 bytes) $02CA 2 Pointer to packet buffer RECV (Default: $E600, under kernel, 1536 bytes) $02CC 2 Pointer to trigger byte to swap cartridge out (Will store $00 to location) $02CE 2 Pointer to trigger byte to swap cartridge in (Will store $FF to location) === Original vector pointers === $02D0 2 HW Interrupt $02D2 2 NMI $02D4 2 Kernel (OPEN) $02D6 2 Kernel (CLOSE) $02D8 2 Kernel (CHKIN) $02DA 2 Kernel (CHKOUT) $02DC 2 Kernel (CLRCHN) $02DE 2 Kernel (CHRIN) $02E0 2 Kernel (CHROUT) $02E2 2 Kernel (STOP) $02E4 2 Kernel (GETIN) $02E6 2 Kernel (CLALL) $02E8 2 Kernel (LOAD) $02EA 2 Kernel (SAVE) $02EC 2 Pointer to hostname (Default $03E8, null terminated) $02EE 9 Small routine to call SHUTDOWN then swap out ROM (SYS 750) JSR SHUTDOWN LDA #$00 STA ($02CC) RTS $02F7 9 Small routine to swap cart in and call WARMSTART (SYS 759) LDA #$FF STA ($02CE) JMP WARMSTART RTS $03E8 Hostname (Default location, 16 chars with null terminator === Beginning of ROM === $8000 - 5 'CBM80' $8005 2 COLDSTART vector $8007 2 WARMSTART vector $8009 15 Filename to autostart from TFTP === Copied to configuration area on boot, default config can be burned into ROM === $8018 4 IP address (0.1.2.3) $801C 4 Netmask (0.1.2.3) $8020 4 Gateway (0.1.2.3) $8024 4 DNS (0.1.2.3) $8028 4 TFTP address (0.1.2.3) $802C 2 TFTP port $802E 2 Flags 15: Get config from DHCP 14: Autoboot from TFTP 13-0: Reserved (0) $8030 2 MTU (>1500 not allowed) $8032 6 MAC address $8040 16 File name (null terminated) to boot from TFTP $8050 16 Hostname (Null terminated) $8060 16 Username (For SLIP/PPP) $8070 16 Password (For SLIP/PPP) $8080 128 Reserved $8100 * 1792 Hardware driver (Responsible for receiving and sending data) $8100 2 Vector (L2_RECVBYTE) $8102 2 Vector (L2_SENDBYTE) $8104 2 Vector (L2_RECVPKT) $8106 2 Vector (L2_SENDPKT) $8108 2 Vector (L2_INIT) $810A 2 Vector (L2_RESET) $810C 2 Vector (L2_COPYPKT) $810E 2 Vector (L2_IRQ) $8110 - $87FF Hardware driver code $8800 - $8FFF Kernal interface $8800 2 Vector (KIP_OPEN) $8802 2 Vector (KIP_CLOSE) $8804 2 Vector (KIP_CHKIN) $8806 2 Vector (KIP_CHKOUT) $8808 2 Vector (KIP_CLRCHN) $880A 2 Vector (KIP_CHRIN) $880C 2 Vector (KIP_CHROUT) $880E 2 Vector (KIP_STOP) $8810 2 Vector (KIP_GETIN) $8812 2 Vector (KIP_CLALL) $8814 2 Vector (KIP_LOAD) $8816 2 Vector (KIP_SAVE) $8818 2 Vector (KIP_ISDEV7) $881A 2 Vector (KIP_STR2IPINF) $881C 2 Vector (KIP_SECHAN2FLAGS) $881E 2 Vector (KIP_ISDEV7) $8820 2 Vector (KIP_SECADDR2FLAGS) $8822 2 Vector (KIP_ERRCHAN) $8824 2 Vector (KIP_IRQ) $8830 - $8FFF Kernal interface code $ $9C00 - $9FFF TCP/IP application/config code $9000 2 Vector (IP_INIT_CONFIG) $9002 2 Vector (IP_SHUTDOWN) $9004 2 Vector (IP_DHCP_REQUEST) $9006 2 Vector (IP_DHCP_RENEW) $9008 2 Vector (IP_DHCP_RELEASE) $900A 2 Vector (IP_TFTP_LISTEN) $900C 2 Vector (IP_TFTP_RECV) $900E 2 Vector (IP_TFTP_SEND) ====================================== $E000 1536 Default packet buffer 1 $E600 1536 Default packet buffer 2 $EC00 1024 Reserved for driver use $F000 16*16 Connection descriptors Connection descriptor format (32 bytes) 0-3 Remote IP address (Bind/Destination) 4-5 Port Number 6-7 Flags: 15-14: (tcp) 00: Connection closed 01: SYN sent 10: ACK received (from SYN) 11: Connection open 15-14: (udp) 0x: Port closed 1x: Port open x0: Port is UDP x1: Port is raw IP 13: 0: Port is TCP 1: Port is UDP or IP 12: 1=Port is listening (TCP) 1=Port is enabled (UDP) 0=Port is not listening or enabled 11: 1= Kernel trampoline at $02D0 KTRMP BCC KOUT LDA $01 STA $02FF ORA #$01 STA $01 JMP END END