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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
|
/* $OpenBSD: pmap_bootstrap.c,v 1.13 2000/02/22 19:27:52 deraadt Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.30 1997/01/07 07:44:01 scottr Exp $ */
/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)pmap_bootstrap.c 8.1 (Berkeley) 6/10/93
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/msgbuf.h>
#include <sys/reboot.h>
#include <vm/vm.h>
#include <machine/pte.h>
#include <mac68k/mac68k/clockreg.h>
#include <machine/vmparam.h>
#include <machine/cpu.h>
#include <machine/pmap.h>
#include <machine/autoconf.h>
#include <ufs/mfs/mfs_extern.h>
#include "macrom.h"
#define PA2VA(v, t) (t)((u_int)(v) - firstpa)
extern char *etext;
extern int Sysptsize;
extern char *extiobase, *proc0paddr;
extern st_entry_t *Sysseg;
extern pt_entry_t *Sysptmap, *Sysmap;
extern int maxmem, physmem;
extern int avail_remaining, avail_range, avail_end;
extern vm_offset_t avail_start, avail_next;
extern vm_offset_t virtual_avail, virtual_end;
extern vm_size_t mem_size;
extern int protection_codes[];
/*
* These are used to map the RAM:
*/
int numranges; /* = 0 == don't use the ranges */
u_long low[8];
u_long high[8];
extern int nbnumranges;
extern u_long nbphys[];
extern u_long nblog[];
extern signed long nblen[];
#define VIDMAPSIZE btoc(m68k_round_page(vidlen))
extern u_int32_t mac68k_vidlog;
extern u_int32_t mac68k_vidphys;
extern u_int32_t videoaddr;
extern u_int32_t videorowbytes;
extern u_int32_t videosize;
static int vidlen;
static u_int32_t newvideoaddr;
extern caddr_t ROMBase;
/*
* Special purpose kernel virtual addresses, used for mapping
* physical pages for a variety of temporary or permanent purposes:
*
* CADDR1, CADDR2: pmap zero/copy operations
* vmmap: /dev/mem, crash dumps, parity error checking
* msgbufp: kernel message buffer
*/
caddr_t CADDR1, CADDR2, vmmap;
/*
* Bootstrap the VM system.
*
* This is called with the MMU either on or off. If it's on, we assume
* that it's mapped with the same PA <=> LA mapping that we eventually
* want. The page sizes and the protections will be wrong, anyway.
*
* nextpa is the first address following the loaded kernel. On a IIsi
* on 12 May 1996, that was 0xf9000 beyond firstpa.
*/
void
pmap_bootstrap(nextpa, firstpa)
vm_offset_t nextpa;
register vm_offset_t firstpa;
{
vm_offset_t kstpa, kptpa, vidpa, iiopa, rompa;
vm_offset_t kptmpa, lkptpa, p0upa;
u_int nptpages, kstsize;
int i;
register st_entry_t protoste, *ste;
register pt_entry_t protopte, *pte, *epte;
vidlen = ((videosize >> 16) & 0xffff) * videorowbytes + PGOFSET;
/*
* Calculate important physical addresses:
*
* kstpa kernel segment table 1 page (!040)
* N pages (040)
*
* kptpa statically allocated
* kernel PT pages Sysptsize+ pages
*
* vidpa internal video space for some machines
* PT pages VIDMAPSIZE pages
*
* rompa ROM space
* PT pages ROMMAPSIZE pages
*
* iiopa internal IO space
* PT pages IIOMAPSIZE pages
*
* [ Sysptsize is the number of pages of PT, IIOMAPSIZE and
* NBMAPSIZE are the number of PTEs, hence we need to round
* the total to a page boundary with IO maps at the end. ]
*
* kptmpa kernel PT map 1 page
*
* lkptpa last kernel PT page 1 page
*
* p0upa proc 0 u-area UPAGES pages
*
*/
if (mmutype == MMU_68040)
kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
else
kstsize = 1;
kstpa = nextpa;
nextpa += kstsize * NBPG;
kptpa = nextpa;
nptpages = Sysptsize +
(IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE + NPTEPG - 1) / NPTEPG;
nextpa += nptpages * NBPG;
vidpa = nextpa - VIDMAPSIZE * sizeof(pt_entry_t);
rompa = vidpa - ROMMAPSIZE * sizeof(pt_entry_t);
iiopa = rompa - IIOMAPSIZE * sizeof(pt_entry_t);
kptmpa = nextpa;
nextpa += NBPG;
lkptpa = nextpa;
nextpa += NBPG;
p0upa = nextpa;
nextpa += USPACE;
if (nextpa > high[0]) {
printf("Failure in BSD boot. nextpa=0x%lx, high[0]=0x%lx.\n",
nextpa, high[0]);
printf("You're hosed! Try booting with 32-bit addressing ");
printf("enabled in the memory control panel.\n");
printf("Older machines may need Mode32 to get that option.\n");
panic("Cannot work with the current memory mappings.");
}
/*
* Initialize segment table and kernel page table map.
*
* On 68030s and earlier MMUs the two are identical except for
* the valid bits so both are initialized with essentially the
* same values. On the 68040, which has a mandatory 3-level
* structure, the segment table holds the level 1 table and part
* (or all) of the level 2 table and hence is considerably
* different. Here the first level consists of 128 descriptors
* (512 bytes) each mapping 32mb of address space. Each of these
* points to blocks of 128 second level descriptors (512 bytes)
* each mapping 256kb. Note that there may be additional "segment
* table" pages depending on how large MAXKL2SIZE is.
*
* XXX cramming two levels of mapping into the single "segment"
* table on the 68040 is intended as a temporary hack to get things
* working. The 224mb of address space that this allows will most
* likely be insufficient in the future (at least for the kernel).
*/
if (mmutype == MMU_68040) {
register int num;
/*
* First invalidate the entire "segment table" pages
* (levels 1 and 2 have the same "invalid" value).
*/
pte = PA2VA(kstpa, u_int *);
epte = &pte[kstsize * NPTEPG];
while (pte < epte)
*pte++ = SG_NV;
/*
* Initialize level 2 descriptors (which immediately
* follow the level 1 table). We need:
* NPTEPG / SG4_LEV3SIZE
* level 2 descriptors to map each of the nptpages+1
* pages of PTEs. Note that we set the "used" bit
* now to save the HW the expense of doing it.
*/
num = (nptpages + 1) * (NPTEPG / SG4_LEV3SIZE);
pte = &(PA2VA(kstpa, u_int *))[SG4_LEV1SIZE];
epte = &pte[num];
protoste = kptpa | SG_U | SG_RW | SG_V;
while (pte < epte) {
*pte++ = protoste;
protoste += (SG4_LEV3SIZE * sizeof(st_entry_t));
}
/*
* Initialize level 1 descriptors. We need:
* roundup(num, SG4_LEV2SIZE) / SG4_LEV2SIZE
* level 1 descriptors to map the `num' level 2's.
*/
pte = PA2VA(kstpa, u_int *);
epte = &pte[roundup(num, SG4_LEV2SIZE) / SG4_LEV2SIZE];
protoste = (u_int)&pte[SG4_LEV1SIZE] | SG_U | SG_RW | SG_V;
while (pte < epte) {
*pte++ = protoste;
protoste += (SG4_LEV2SIZE * sizeof(st_entry_t));
}
/*
* Initialize the final level 1 descriptor to map the last
* block of level 2 descriptors.
*/
ste = &(PA2VA(kstpa, u_int*))[SG4_LEV1SIZE-1];
pte = &(PA2VA(kstpa, u_int*))[kstsize*NPTEPG - SG4_LEV2SIZE];
*ste = (u_int)pte | SG_U | SG_RW | SG_V;
/*
* Now initialize the final portion of that block of
* descriptors to map the "last PT page".
*/
pte = &(PA2VA(kstpa, u_int*))
[kstsize*NPTEPG - NPTEPG/SG4_LEV3SIZE];
epte = &pte[NPTEPG/SG4_LEV3SIZE];
protoste = lkptpa | SG_U | SG_RW | SG_V;
while (pte < epte) {
*pte++ = protoste;
protoste += (SG4_LEV3SIZE * sizeof(st_entry_t));
}
/*
* Initialize Sysptmap
*/
pte = PA2VA(kptmpa, u_int *);
epte = &pte[nptpages+1];
protopte = kptpa | PG_RW | PG_CI | PG_V;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
/*
* Invalidate all but the last remaining entries in both.
*/
epte = &(PA2VA(kptmpa, u_int *))[NPTEPG-1];
while (pte < epte) {
*pte++ = PG_NV;
}
pte = &(PA2VA(kptmpa, u_int *))[NPTEPG-1];
*pte = lkptpa | PG_RW | PG_CI | PG_V;
} else {
/*
* Map the page table pages in both the HW segment table
* and the software Sysptmap. Note that Sysptmap is also
* considered a PT page hence the +1.
*/
ste = PA2VA(kstpa, u_int*);
pte = PA2VA(kptmpa, u_int*);
epte = &pte[nptpages+1];
protoste = kptpa | SG_RW | SG_V;
protopte = kptpa | PG_RW | PG_CI | PG_V;
while (pte < epte) {
*ste++ = protoste;
*pte++ = protopte;
protoste += NBPG;
protopte += NBPG;
}
/*
* Invalidate all but the last remaining entries in both.
*/
epte = &(PA2VA(kptmpa, u_int *))[NPTEPG-1];
while (pte < epte) {
*ste++ = SG_NV;
*pte++ = PG_NV;
}
/*
* Initialize the last to point to point to the page
* table page allocated earlier.
*/
*ste = lkptpa | SG_RW | SG_V;
*pte = lkptpa | PG_RW | PG_CI | PG_V;
}
/*
* Invalidate all but the final entry in the last kernel PT page
* (u-area PTEs will be validated later). The final entry maps
* the last page of physical memory.
*/
pte = PA2VA(lkptpa, u_int *);
epte = &pte[NPTEPG-1];
while (pte < epte)
*pte++ = PG_NV;
*pte = (0xFFFFF000) | PG_RW | PG_CI | PG_V; /* XXX */
/*
* Initialize kernel page table.
* Start by invalidating the `nptpages' that we have allocated.
*/
pte = PA2VA(kptpa, u_int *);
epte = &pte[nptpages * NPTEPG];
while (pte < epte)
*pte++ = PG_NV;
/*
* Validate PTEs for kernel text (RO)
*/
pte = &(PA2VA(kptpa, u_int *))[m68k_btop(KERNBASE)];
epte = &pte[m68k_btop(m68k_trunc_page(&etext))];
#if defined(KGDB) || defined(DDB)
protopte = firstpa | PG_RW | PG_V; /* XXX RW for now */
#else
protopte = firstpa | PG_RO | PG_V;
#endif
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
/*
* Validate PTEs for kernel data/bss, dynamic data allocated
* by us so far (nextpa - firstpa bytes), and pages for proc0
* u-area and page table allocated below (RW).
*/
epte = &(PA2VA(kptpa, u_int *))[m68k_btop(nextpa - firstpa)];
protopte = (protopte & ~PG_PROT) | PG_RW;
/*
* Enable copy-back caching of data pages
*/
if (mmutype == MMU_68040)
protopte |= PG_CCB;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
/*
* Finally, validate the internal IO space PTEs (RW+CI).
* We do this here since the 320/350 MMU registers (also
* used, but to a lesser extent, on other models) are mapped
* in this range and it would be nice to be able to access
* them after the MMU is turned on.
*/
pte = PA2VA(iiopa, u_int *);
epte = PA2VA(rompa, u_int *);
protopte = IOBase | PG_RW | PG_CI | PG_V;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
pte = PA2VA(rompa, u_int *);
epte = PA2VA(vidpa, u_int *);
protopte = ((u_int) ROMBase) | PG_RO | PG_V;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
if (vidlen) {
pte = PA2VA(vidpa, u_int *);
epte = pte + VIDMAPSIZE;
protopte = (mac68k_vidphys & ~PGOFSET) | PG_RW | PG_V | PG_CI;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
}
}
/*
* Calculate important exported kernel virtual addresses
*/
/*
* Sysseg: base of kernel segment table
*/
Sysseg = PA2VA(kstpa, st_entry_t *);
/*
* Sysptmap: base of kernel page table map
*/
Sysptmap = PA2VA(kptmpa, pt_entry_t *);
/*
* Sysmap: kernel page table (as mapped through Sysptmap)
* Immediately follows `nptpages' of static kernel page table.
*/
Sysmap = (pt_entry_t *)m68k_ptob(nptpages * NPTEPG);
IOBase = (u_long)m68k_ptob(nptpages*NPTEPG -
(IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE));
ROMBase = (char *)m68k_ptob(nptpages*NPTEPG -
(ROMMAPSIZE + VIDMAPSIZE));
if (vidlen) {
newvideoaddr = (u_int32_t)
m68k_ptob(nptpages*NPTEPG - VIDMAPSIZE)
+ (mac68k_vidphys & PGOFSET);
if (mac68k_vidlog)
mac68k_vidlog = newvideoaddr;
}
/*
* Setup u-area for process 0.
*/
/*
* Zero the u-area.
* NOTE: `pte' and `epte' aren't PTEs here.
*/
pte = PA2VA(p0upa, u_int *);
epte = (u_int *) (PA2VA(p0upa, u_int) + USPACE);
while (pte < epte)
*pte++ = 0;
/*
* Remember the u-area address so it can be loaded in the
* proc struct p_addr field later.
*/
proc0paddr = PA2VA(p0upa, char *);
/*
* VM data structures are now initialized, set up data for
* the pmap module.
*/
avail_next = avail_start = m68k_round_page(nextpa);
avail_remaining = 0;
avail_range = -1;
for (i = 0; i < numranges; i++) {
if (avail_next >= low[i] && avail_next < high[i]) {
avail_range = i;
avail_remaining = high[i] - avail_next;
} else if (avail_range != -1) {
avail_remaining += (high[i] - low[i]);
}
}
physmem = m68k_btop(avail_remaining + nextpa - firstpa);
avail_remaining -= m68k_round_page(MSGBUFSIZE);
high[numranges - 1] -= m68k_round_page(MSGBUFSIZE);
/* XXX -- this doesn't look correct to me. */
while (high[numranges - 1] < low[numranges - 1]) {
numranges--;
high[numranges - 1] -= low[numranges] - high[numranges];
}
avail_remaining = m68k_trunc_page(avail_remaining);
avail_end = avail_start + avail_remaining;
avail_remaining = m68k_btop(avail_remaining);
mem_size = m68k_ptob(physmem);
virtual_avail = VM_MIN_KERNEL_ADDRESS + (nextpa - firstpa);
virtual_end = VM_MAX_KERNEL_ADDRESS;
/*
* Initialize protection array.
* XXX don't use a switch statement, it might produce an
* absolute "jmp" table.
*/
{
register int *kp;
kp = (int *) &protection_codes;
kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_NONE] = 0;
kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_NONE] = PG_RO;
kp[VM_PROT_READ|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
kp[VM_PROT_NONE|VM_PROT_NONE|VM_PROT_EXECUTE] = PG_RO;
kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
kp[VM_PROT_NONE|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_NONE] = PG_RW;
kp[VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;
}
/*
* Kernel page/segment table allocated in locore,
* just initialize pointers.
*/
{
struct pmap *kpm = (struct pmap *)&kernel_pmap_store;
kpm->pm_stab = Sysseg;
kpm->pm_ptab = Sysmap;
simple_lock_init(&kpm->pm_lock);
kpm->pm_count = 1;
kpm->pm_stpa = (st_entry_t *)kstpa;
/*
* For the 040 we also initialize the free level 2
* descriptor mask noting that we have used:
* 0: level 1 table
* 1 to `num': map page tables
* MAXKL2SIZE-1: maps last-page page table
*/
if (mmutype == MMU_68040) {
register int num;
kpm->pm_stfree = ~l2tobm(0);
num = roundup((nptpages + 1) * (NPTEPG / SG4_LEV3SIZE),
SG4_LEV2SIZE) / SG4_LEV2SIZE;
while (num)
kpm->pm_stfree &= ~l2tobm(num--);
kpm->pm_stfree &= ~l2tobm(MAXKL2SIZE-1);
for (num = MAXKL2SIZE;
num < sizeof(kpm->pm_stfree)*NBBY;
num++)
kpm->pm_stfree &= ~l2tobm(num);
}
}
/*
* Allocate some fixed, special purpose kernel virtual addresses
*/
{
extern vm_offset_t tmp_vpages[];
vm_offset_t va = virtual_avail;
CADDR1 = (caddr_t)va;
va += NBPG;
CADDR2 = (caddr_t)va;
va += NBPG;
vmmap = (caddr_t)va;
va += NBPG;
tmp_vpages[0] = va;
va += NBPG;
msgbufp = (struct msgbuf *)va;
va += MSGBUFSIZE;
virtual_avail = va;
}
}
void
bootstrap_mac68k(tc)
int tc;
{
extern void zs_init __P((void));
extern caddr_t esym;
vm_offset_t nextpa;
caddr_t oldROMBase;
if (mac68k_machine.do_graybars)
printf("Bootstrapping OpenBSD/mac68k.\n");
oldROMBase = ROMBase;
mac68k_vidphys = videoaddr;
if (((tc & 0x80000000) && (mmutype == MMU_68030)) ||
((tc & 0x8000) && (mmutype == MMU_68040))) {
if (mac68k_machine.do_graybars)
printf("Getting mapping from MMU.\n");
(void) get_mapping();
if (mac68k_machine.do_graybars)
printf("Done.\n");
} else {
/* MMU not enabled. Fake up ranges. */
nbnumranges = 0;
numranges = 1;
low[0] = 0;
high[0] = mac68k_machine.mach_memsize * (1024 * 1024);
if (mac68k_machine.do_graybars)
printf("Faked range to byte 0x%lx.\n", high[0]);
}
nextpa = load_addr + (((int)esym + NBPG - 1) & PG_FRAME);
#if MFS
if (boothowto & RB_MINIROOT) {
int v;
boothowto |= RB_DFLTROOT;
nextpa = m68k_round_page(nextpa);
if ((v = mfs_initminiroot((caddr_t) nextpa-load_addr)) == 0) {
printf("Error loading miniroot.\n");
}
printf("Loaded %d byte miniroot.\n", v);
nextpa += v;
}
#endif
if (mac68k_machine.do_graybars)
printf("Bootstrapping the pmap system.\n");
pmap_bootstrap(nextpa, load_addr);
if (mac68k_machine.do_graybars)
printf("Pmap bootstrapped.\n");
if (!vidlen)
panic("Don't know how to relocate video!");
if (mac68k_machine.do_graybars)
printf("Moving ROMBase from %p to %p.\n",
oldROMBase, ROMBase);
mrg_fixupROMBase(oldROMBase, ROMBase);
if (mac68k_machine.do_graybars)
printf("Video address 0x%lx -> 0x%lx.\n",
(unsigned long) videoaddr,
(unsigned long) newvideoaddr);
mac68k_set_io_offsets(IOBase);
/*
* If the serial ports are going (for console or 'echo'), then
* we need to make sure the IO change gets propagated properly.
* This resets the base addresses for the 8530 (serial) driver.
*
* WARNING!!! No printfs() (etc) BETWEEN zs_init() and the end
* of this function (where we start using the MMU, so the new
* address is correct.
*/
if ( (mac68k_machine.serial_boot_echo)
|| (mac68k_machine.serial_console))
zs_init();
videoaddr = newvideoaddr;
}
|