Commit Graph

9 Commits

Author SHA1 Message Date
Greg Hewgill
0604bd1515 add fileno() method to ControlHandler for better compatiblity with select() 2011-08-20 18:22:33 +12:00
Greg Hewgill
0b86a8693f disassemble show instruction bytes 2011-08-20 15:37:55 +12:00
Greg Hewgill
29b1342a47 reincarnate disassembler on control channel 2011-08-20 14:23:51 +12:00
Greg Hewgill
aee0bba7aa add dump memory command 2011-08-20 13:59:36 +12:00
Greg Hewgill
8b62860152 refactor control command processing 2011-08-20 13:59:22 +12:00
Greg Hewgill
19693bc905 start of cpu core control channel
Currently this listens on TCP port 6502 on localhost. The protocol
is a simple text protocol, type "help" for a list of commands.
2011-08-19 21:48:46 +12:00
Greg Hewgill
15e174c02a rename --ui switch to --bus 2011-08-19 20:30:55 +12:00
Greg Hewgill
cd692af6f3 use sockets for comms instead of stdio 2011-08-18 21:04:11 +12:00
Greg Hewgill
c9c609be1d Separate CPU core and UI processes
This is a first step toward separating the CPU core and UI.  The UI program
starts the CPU core as a subprocess and communicates through its standard input
and output. The protocol is deliberately simple at this point. Each bus request
from the core is exactly eight bytes:

    +-------------------------+
    | cpu cycle counter high  |
    +-------------------------+
    | cpu cycle counter       |
    +-------------------------+
    | cpu cycle counter       |
    +-------------------------+
    | cpu cycle counter low   |
    +-------------------------+
    | 0x00=read / 0x01=write  |
    +-------------------------+
    | address high            |
    +-------------------------+
    | address low             |
    +-------------------------+
    | value (unused for read) |
    +-------------------------+

A single-byte response from the UI is required for a read request, and a
response must not be sent for a write request.

The above protocol is expected to change. For example:

    - the UI should tell the CPU core which address ranges are of interest
    - needs ability to send memory images to the core (both ROM and RAM)

The stream communications is currently buggy because it expects that all eight
bytes will be read when requested (that is, partial reads are not handled). In
practice, this seems to work okay for the moment.

To improve portability, it may be better to communicate over TCP sockets
instead of stdin/stdout.
2011-08-16 12:54:23 +12:00