forked from EtchedPixels/Virtual68
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manual
144 lines (86 loc) · 3.31 KB
/
Manual
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Virtual Hardware
68000
Memory
------
RAM at 0 for 512K
Banked RAM at 1MB for 256K (designed for testing simple fixed MMU
setup equivalents and also the banked
memory option on the N8VEM 68K board)
Quite how the boot code magically teleports from ROM into RAM is not
emulated, as it doesn't matter.
IDE
---
A "classic" 16bit IDE controller at 00F01000, with registers at 2 byte
intervals to allow for a 16bit data register
No interrupt
MMU
---
Three different modes
- Basic - traps user access below a fixed base (64K)
- Atari proposed simple MMU
$xxF02000 sets the mask bits of the MMU
$xxF02010 sets the root (xor) bits of the MMU
$xxF02020 is a fault flag which is set when the MMU faults, and
cleared by reading it or acking the interrupt
Low 12 bits are fixed upper bits in register.
The faulting address is not captured as it's meant to be a simple MMU.
The addressing rules are
Supervisor: always linear
User: physical = (virtual & mask) ^ root
and a fault is raised if the unmasked bits are not all 0 or 1.
- Classic Base/Limit
$xxF02000 sets the limit (after base adjustment)
$xxF02010 sets the base address
$xxF02020 is a fault flag which is set when the MMU faults, and
cleared by reading it or acking the interrupt
Low 12 bits are fixed upper bits in register.
MMU faults block the access and report IRQ 7. This may change to NMI or bus
error when experimenting more, but it's interesting as an IRQ because that
is generic to all CPUs.
Serial Port
-----------
$xxF03000 read/write byte writes or fetches data
$xxF03010 read - bit 0 indicates character for reading, bit 1 write space
(Need to add a couple of extra ports via pty or similar)
Currently no interrupt, need to add
RTC/Timer
---------
$xxF04000 set the timer rate or disable if 0
$xxF04010-7 read the current unsigned unix time (64bit hi->lo)
$xxF04020 read the current deciseconds value 0-9
IRQ 6, cleared by acking
Banked Memory
-------------
$xxF05000 get/set the current bank number (0-3)
Note: the emulator core does try to emulate 68000 prefetcing behaviour and
the like, but trying to do a live switch from bank to bank (ie switching the
bank under you with PC pointing into the banked memory) hasn't been compared
to real hardware so be cautious.
** To implement**
Framebuffer
Character keyboard I/O not line by line
UART emulation ?
Virtual Software
Boot loads block 0 from IDE device 0 to 0x1000 and if 0x1000 contains the
magic number 15C0DE68 then it jumps to 0x1004 with A6 holding the pointer to
the service jump table and D0 holding the number of the boot disk. IRQs are off
and supervisor mode is in force.
The provided services are a jump table off a6
Halt 0
Returns to the boot prompt assuming you didn't trash the low memory
Chrout 1
Output the character in D0
Strout 2
Output the string in A3 (may change to A2 shortly)
Chrin 3
Read the next character into D0, wait if needed
Chrpoll 4
Return D0 bit 0 true for read ready D0 bit 1 true for write ready
Strin 5
Call with A2 as a buffer pointer and D2 as the buffer length including the
\0 and the routine will do line input handling
DiskRead 6
Read disk block D1 from device D0 into memory at address A0
All service routines may trash A0/D0/A1/D1 and the passed arguments. All
service routines are likely to change! All are intended to be used from
supervisor mode only