Mercurial > hg > Members > kono > nitros9-code
comparison level3/Level3.doc @ 2349:f506d1905781
Added Level 3
author | boisy |
---|---|
date | Sun, 17 Jan 2010 21:35:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2348:8132c03a36cf | 2349:f506d1905781 |
---|---|
1 The Level III modifications are Copyright 1996 by Alan T. DeKok, all rights | |
2 reserved. | |
3 | |
4 | |
5 Level III | |
6 ========= | |
7 | |
8 It's what everybody's been asking for, so here goes. | |
9 | |
10 One warning: Level III is VERY dependant on the order of modules in the | |
11 OS9Boot file. If you do NOT follow the directions below exactly, your | |
12 system will NOT BOOT. I'm willing to answer questions and perform support, | |
13 but Level III is not for the faint of heart or the OS-9 beginner. | |
14 | |
15 When you install Level III, you MUST do it on a system using NitrOS-9. | |
16 | |
17 When you build a Level III OS9Boot, be aware that you WILL NOT be able | |
18 to cobbler a disk once LIII is booted. You must copy the OS9Boot by hand, | |
19 and use 'ezgen' to update LSN0, or use OS9Gen. | |
20 | |
21 ****************************************************************************** | |
22 ** DO NOT COBBLER DISKS WITH LEVEL III! IT WILL COBBLER BUT WILL NOT BOOT! ** | |
23 ****************************************************************************** | |
24 | |
25 Your OS9Boot file MUST be magically formatted as follows. The reasons for | |
26 this are long and detailed. I'll just say that if it isn't done this way, | |
27 Level III will NOT work. | |
28 | |
29 ****** start of the OS9Boot file. | |
30 NitrOS9 (from the NitrOS9.L3 file.) | |
31 SCF | |
32 (other SCF modules, i.e. SACIA, Printer, VRN) | |
33 ( NOT CC3IO or WindInt or VDGInt. Never!) | |
34 (up to a limit of 15k of modules) | |
35 _end <--- specifies the end of SCF information, from the _end.L3 file. | |
36 RBF | |
37 (other RBF modules, i.e. CC3Disk, Rammer, RamPak, CCHDisk, etc.) | |
38 _end <--- specifies the end of RBF information | |
39 (everything else. Order does not matter here.) | |
40 (ALL descriptors, Clock, IOMan, OS9p2, Init, CC3IO, Windint, | |
41 PipeMan, etc.) | |
42 ****** End of the OS9Boot file. | |
43 | |
44 Late tests indicate it is possible to put CC3IO inside the SCF local memory. | |
45 Whether or not it works is dependent on local system configurations. Either | |
46 way, there's plenty of system memory, and it doesn't appear to make any | |
47 difference to anything. | |
48 | |
49 Similarly, PipeMan may be put in SCF local memory between SCF and the first | |
50 _end module. Note that PipeMan may NOT be put in with RBF! | |
51 | |
52 An 'ident -s' of my Level III OS9Boot file (with comments) looks like this: | |
53 | |
54 1 $C7 $389B28 . NitrOS9 | |
55 16 $D1 $E2B0EB . SCF \ | |
56 12 $E1 $82D6D3 . SACIA | SCF and SCF device drivers | |
57 1 $E1 $329D69 . VRN | | |
58 13 $E1 $3389A4 . PRINTER / | |
59 1 $C7 $BB7259 . _end | |
60 30 $D1 $753C86 . RBF \ | |
61 4 $E1 $3AB3AA . Rammer | RBF and RBF device drivers | |
62 2 $E1 $BCE29D . RamPak | | |
63 11 $E1 $CFAA38 . CC3Disk / | |
64 1 $C7 $BB7259 . _end | |
65 1 $C1 $BFF958 . OS9p3 everything else | |
66 67 $C0 $680456 . Init | |
67 82 $F1 $7EBD63 . DD DEVICE DESCRIPTORS GO HERE | |
68 82 $F1 $93C195 . D0 | |
69 82 $F1 $F09A9D . D1 | |
70 82 $F1 $323E4F . D2 | |
71 82 $F1 $092A49 . MD | |
72 82 $F1 $B31A99 . R0 | |
73 114 $F1 $FD590E . T2 | |
74 83 $F1 $C9B7C1 . P | |
75 19 $C1 $67D5A0 . WindInt OUTSIDE SCF local memory! | |
76 20 $E1 $B4F1E2 . CC3IO perhaps here, perhaps in SCF local memory | |
77 83 $F1 $17FBEF . Term | |
78 83 $F1 $F8D0CB . W | |
79 83 $F1 $5EA5AA . W1 WINDOW DESCRIPTORS HERE! | |
80 83 $F1 $691BAA . W2 | |
81 83 $F1 $FB498B . W3 | |
82 83 $F1 $05BFAA . W4 | |
83 83 $F1 $97ED8B . W5 | |
84 83 $F1 $E30B59 . W6 | |
85 83 $F1 $710B78 . W7 | |
86 83 $F1 $9F0B78 . W8 | |
87 83 $F1 $0D0B59 . W9 | |
88 18 $C0 $826A54 . OS9p2 All these modules MUST come after the '_end' | |
89 12 $C1 $1B5CA4 . IOMan module, or your system will crash. | |
90 9 $C1 $402FE2 . Clock | |
91 4 $D1 $ED94CC . PipeMan | |
92 2 $E1 $ADB22E . Piper | |
93 80 $F1 $CC06AF . Pipe | |
94 1 $F1 $B2004F . Nil | |
95 | |
96 | |
97 OK, now the theory behind the magic. | |
98 | |
99 When booting OS-9, the startup routine in OS9p1 calls the Boot module to | |
100 load in the OS9Boot file. OS9p1 then looks for a module named 'NitrOS9 | |
101 as the FIRST module of the OS9Boot file. If it exists, that module is called | |
102 BEFORE verifying the OS9Boot file. | |
103 | |
104 The NitrOS9 module allocates memory, and moves the SCF modules (up to | |
105 the _end module) into 'SCF local memory', and verifies the modules. The | |
106 same procedure is followed for RBF modules, and when I get the chance later, | |
107 for PipeMan and SBF modules. | |
108 | |
109 Extra memory is allocated in 16k chunks, and mapped into address $2000 | |
110 to $5FFF of the system map. An 'smap' will show you that this memory is | |
111 allocated. | |
112 | |
113 IOMan intercepts EVERY system call, and EVERY request/return system call. | |
114 Any module inside 'local memory' asking for system RAM gets allocated | |
115 RAM from that local memory. Any module in 'system global memory' asking | |
116 for system RAM gets allocated RAM from the global memory pool. | |
117 | |
118 The net result of this is that you lose 16k of memory from the bottom | |
119 of the system memory map, but you move about 16k of modules into system local | |
120 memory. On my setup, I had about 14K free after booting, and now 'smap' | |
121 usually gives me 11k of _global_ memory free. And I still have 8k of SCF | |
122 memory, and 9k of RBF memory left! | |
123 | |
124 The ONLY things that take memory out of 'system global memory' are process | |
125 descriptors (.5k each) and path descriptors (.0625K, 64 bytes). 11K is | |
126 room for another 20 processes, each with STDIN, STDOUT, and STDERR going | |
127 to a window. And 8k of SCF memory is just about enough memory for SCF | |
128 buffers for each of those 20 processes. | |
129 | |
130 i.e. Level III enables you to have about 25 _different_ processes | |
131 running in different windows, all at the same time! The only way that this | |
132 is possible on a Level II system is to strip your OS9Boot file down to almost | |
133 nothing. Level III allows you to keep all of your favorite modules in your | |
134 OS9Boot. | |
135 | |
136 VDG windows come out of system global memory, too. That's why I added the | |
137 'largest free block' display to the 'sfree' command, below. If you have | |
138 less than 6k free in one block, you can't run many old Coco2 games. | |
139 | |
140 The local 16k memory map is saved and restored across every system call, | |
141 and changed whenever a call to SCF/RBF is done. Because only IOMan knows | |
142 about the changes, only it (and clock) have to be modified. All of the | |
143 old file managers and drivers work perfectly. This includes programs | |
144 like 'winfo' and 'wdir'. | |
145 | |
146 I got the idea from thinking that it's perfectly possible to boot OS-9 | |
147 with NO SCF modules, and likewise with NO RBF modules. If that's possible, | |
148 why not map SCF and RBF into the same area of memory, and switch between | |
149 them on the fly? So far, I would say it's taken me the equivalent of 4 weeks | |
150 full-time work, as I ran into HORRIBLE problems. Level III is sufficiently | |
151 different from Level II that you can't really think the same way about it. | |
152 | |
153 Anyways, here's an 'sfree' of my current system, with OSTerm running | |
154 in another window, and 3 'shell' windows: | |
155 | |
156 ----- Level III System Memory ----- System memory: | |
157 37 free pages, largest block 37 pages. | |
158 9K of free RAM. | |
159 | |
160 SCF local memory: | |
161 21 free pages, largest block 21 pages. | |
162 5K of free RAM. | |
163 | |
164 RBF local memory: | |
165 31 free pages, largest block 31 pages. | |
166 7K of free RAM. | |
167 | |
168 ---- | |
169 That's 89 pages (22K) of free RAM, and my OS9Boot file is $73E2 bytes long! | |
170 Even with a 4K SACia buffer open, 8 processes, and 4 windows! I like it... | |
171 | |
172 Here's an 'smap': | |
173 | |
174 0 1 2 3 4 5 6 7 8 9 A B C D E F | |
175 # = = = = = = = = = = = = = = = = | |
176 0 U U U U U U U U U U U U U U U U | |
177 1 U U U U U U U U U U U U U U U U | |
178 2 U U U U U U U U U U U U U U U U | |
179 3 U U U U U U U U U U U U U U U U | |
180 4 U U U U U U U U U U U U U U U U | |
181 5 U U U U U U U U U U U U U U U U | |
182 6 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
183 7 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
184 8 _ _ _ _ _ U U U U U U U U U U U | |
185 9 U U U U U U U U U U U U U U U U | |
186 A U U U U U U U U U U U U U U U U | |
187 B U U U U U U U U U U U U U U U U | |
188 C U U U U U U U U U U U U U U U U | |
189 D U U U U U U U U U U U U U U U U | |
190 E U U U U U U U U U U U U U U U U | |
191 F U U U U U U U U U U U U U U U . | |
192 | |
193 Number of Free Pages: 37 | |
194 Ram Free in KBytes: 9 | |
195 | |
196 | |
197 --- | |
198 This is enough room to format a disk (greater than 7K), even with many | |
199 processes and OSTerm running! | |
200 | |
201 I've been running Level III for just under a year, and I've had it in | |
202 beta test on 10+ systems for 8 months. One system was running a BBS, and | |
203 at one report was up and running for 2 months without a reboot. I think | |
204 it's stable enough to release to the general public. | |
205 | |
206 Have fun! | |
207 | |
208 Alan DeKok. |