Deleted Added
sdiff udiff text old ( 7977:60051d2262c2 ) new ( 7978:9700266d52f4 )
full compact
1
2
3/* ******************************************
4 * SimOS SRM Console
5 *
6 * Derived from Lance Berc's SRM console
7 * for the SRC XXMïż½Machine
8 * ******************************************/
9
10
11/* from simos */
12typedef unsigned long long uint64;
13#include "machine_defs.h"
14#include "new_aouthdr.h"
15#include "alpha_access.h"
16#if 0
17#include "srcmax.h"
18#endif
19
20/* from ../h */
21#include "lib.h"
22#include "rpb.h"
23#include "cserve.h"
24

--- 34 unchanged lines hidden (view full) ---

59#define NUM_KERNEL_THIRD (4)
60
61
62static unixBoot(int go, int argc, char **argv);
63void jToPal(ul bootadr);
64void SlaveLoop(int cpu);
65
66
67AlphaAccess simosConf;
68
69/* **************************************************************
70 * Console callbacks use VMS calling conventions
71 * read AXP manual, 2-64.
72 * ***************************************************************/
73typedef struct OpenVMSFunc {
74 long dummy;
75 long func;

--- 31 unchanged lines hidden (view full) ---

107
108void InitConsole(void)
109{
110#if 0
111 CDR->intr_status =(DevRegister)(DEV_CNSLE_RX_INTR |DEV_CNSLE_TX_INTR);
112#endif
113}
114
115void PutChar(char c)
116{
117#if 0
118 CDR->data = c;
119#endif
120#if 0
121 *(int*) PHYS_TO_K1(SLOT_D_COM1<<5) = c;
122#endif
123 AlphaAccess *k1Conf = (AlphaAccess *)(__MAGIC_ZONE(0, 0, MAGIC_ZONE_EV5_ALIAS));
124 k1Conf->outputChar = c;
125
126}
127
128
129int passArgs(int argc)
130{
131 ;
132}
133
134
135main(int argc, char **argv)
136{
137 int x,i;
138 AlphaAccess *k1Conf = (AlphaAccess *)(__MAGIC_ZONE(0, 0, MAGIC_ZONE_EV5_ALIAS));
139 ui *k1ptr,*ksegptr;
140
141
142 InitConsole();
143 printf("SimOS console \n");
144 /*
145 * get configuration from backdoor
146 */

--- 23 unchanged lines hidden (view full) ---

170 return x;
171}
172
173/*
174 * BOOTING
175 */
176struct rpb xxm_rpb = {
177 NULL, /* 000: physical self-reference */
178 'H'|('W'<<8)|('R'<<16)|('P'<<24)|('B'<<32), /* 008: contains string "HWRPB" */
179 6, /* 010: HWRPB version number */
180 /* the byte count is wrong, but who needs it? - lance */
181 0, /* 018: bytes in RPB perCPU CTB CRB MEDSC */
182 0, /* 020: primary cpu id */
183 8192, /* 028: page size in bytes */
184 43, /* 030: number of phys addr bits */
185 127, /* 038: max valid ASN */
186 {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1'}, /* 040: system serial num: 10 ascii chars */

--- 51 unchanged lines hidden (view full) ---

238struct rpb_percpu xxm_rpb_percpu = {
239 {0,0,0,0,0,0,0,{0,0},{0,0,0,0,0,0,0,0}}, /* 000: boot/restart HWPCB */
240 (STATE_PA | STATE_PP | STATE_CV | STATE_PV | STATE_PMV | STATE_PL), /* 080: per-cpu state bits */
241 0xc000, /* 088: palcode memory length */
242 0x2000, /* 090: palcode scratch length */
243 0x4000, /* 098: phys addr of palcode mem space */
244 0x2000, /* 0A0: phys addr of palcode scratch space */
245 (2 << 16) | (5 << 8) | 1, /* 0A8: PALcode rev required */
246 5|(2<<32), /* 0B0: processor type */
247 7, /* 0B8: processor variation */
248 'D'|('a'<<8)|('v'<<16)|('e'<<24), /* 0C0: processor revision */
249 {'D','a','v','e','C','o','n','r','o','y',0,0,0,0,0,0}, /* 0C8: proc serial num: 10 ascii chars */
250 0, /* 0D8: phys addr of logout area */
251 0, /* 0E0: length in bytes of logout area */
252 0, /* 0E8: halt pcb base */
253 0, /* 0F0: halt pc */
254 0, /* 0F8: halt ps */

--- 111 unchanged lines hidden (view full) ---

366 unix_boot_mem += (pages * 8192);
367 return ret;
368}
369
370ul *first = 0;
371ul *third_rpb = 0;
372ul *reservedFixup = 0;
373
374struct rpb *rpb;
375
376unixBoot(int go, int argc, char **argv)
377{
378 ul *second, *third_kernel, ptr, *tbb, size, *percpu_logout;
379 unsigned char *mdt_bitmap;
380 long *lp1, *lp2, sum;
381 int i, cl;

--- 390 unchanged lines hidden (view full) ---

772 if (rpb->rpb_size > 8192*HWRPB_PAGES) {
773 panic("HWRPB_PAGES=%d too small for HWRPB !!! \n");
774 }
775
776
777 {
778 ul *ptr = (ul*)((char*)rpb_dsr + sizeof(struct rpb_dsr ));
779 rpb_crb->rpb_pa_disp = KSEG_TO_PHYS(ptr);
780 rpb_crb->rpb_va_disp = 0x10000000 + ((ul)ptr&(0x2000*HWRPB_PAGES-1));
781 printf("ConsoleDispatch at virt %x phys %x val %x\n",
782 rpb_crb->rpb_va_disp,
783 rpb_crb->rpb_pa_disp,
784 consoleCallback);
785 *ptr++ = 0;
786 *ptr++ = (ul) consoleCallback;
787 rpb_crb->rpb_pa_fixup = KSEG_TO_PHYS(ptr);
788 rpb_crb->rpb_va_fixup = 0x10000000 + ((ul)ptr& (0x2000*HWRPB_PAGES-1));
789 *ptr++ = 0;
790 *ptr++ = (ul) consoleFixup;
791 }
792
793
794 /* Checksum the rpb for good luck */
795 sum = 0;
796 lp1 = (long *)rpb;

--- 5 unchanged lines hidden (view full) ---

802
803 /*
804 * MP bootstrap
805 */
806
807 {
808 int i;
809 for (i=1;i<simosConf.numCPUs;i++) {
810 volatile AlphaAccess *k1Conf = (volatile AlphaAccess *)
811 (__MAGIC_ZONE(0, 0, MAGIC_ZONE_EV5_ALIAS));
812 SpinLock(&theLock);
813 printf("Bootstraping CPU %d with sp=0x%x \n",
814 i,bootStrapImpure[i]);
815 SpinUnlock(&theLock);
816 k1Conf->bootStrapImpure = bootStrapImpure[i];
817 k1Conf->bootStrapCPU = i;
818 }

--- 120 unchanged lines hidden (view full) ---

939 * Console I/O
940 * ******************************************/
941
942int numOpenDevices = 11;
943struct {
944 char name[128];
945} deviceState[32];
946
947#define BOOTDEVICE_NAME "SCSI 1 0 0 1 100"
948
949void DeviceOperation(long op,long channel, long count, long address, long block)
950{
951 AlphaAccess *k1Conf = (AlphaAccess *)
952 (__MAGIC_ZONE(0, 0, MAGIC_ZONE_EV5_ALIAS));
953
954 long pAddr;
955
956#if 0
957 printf("Console::DeviceRead count=0x%x address=0x%x block=0x%x\n",
958 count,address,block);
959#endif

--- 28 unchanged lines hidden (view full) ---

988
989#define CONSCB_OPEN 0x10
990#define CONSCB_CLOSE 0x11
991#define CONSCB_READ 0x13
992
993#define CONSCB_GETENV 0x22
994
995/* AXP manual 2-26 */
996
997#define ENV_BOOTED_DEV 0x4
998#define ENV_BOOTED_OSFLAGS 0x8
999
1000long CallBackDispatcher(long a0, long a1, long a2, long a3, long a4)
1001{
1002 int i;
1003 switch (a0) {
1004 case CONSCB_PUTS:
1005 for(i=0;i<a3;i++) {
1006 PutChar(*(char *)a2+i);
1007 }
1008 return a3;
1009 case CONSCB_GETENV:
1010 switch (a1) {
1011 case ENV_BOOTED_DEV:
1012 i = strcpy((char*)a2,BOOTDEVICE_NAME);
1013 break;
1014 case ENV_BOOTED_OSFLAGS:
1015 /*
1016 * 'c':ignores the sysconfigtab
1017 *
1018 * i= strcpy((char*)a2,"c");
1019 */
1020 i = strcpy((char*)a2,"");
1021 break;
1022 default:
1023 i = strcpy((char*)a2,"");
1024 printf ("GETENV unsupported option %d\n", a1);
1025 break;
1026 }
1027 if (i > a3) {
1028 panic("CONSCB_GETENV overwrote buffer \n");
1029 }
1030 return i;
1031 case CONSCB_OPEN:
1032 bcopy((char*)a1,deviceState[numOpenDevices].name,a2);

--- 94 unchanged lines hidden ---