Xv6 with picoc & Linkage editor
v1.0
The project delineate mutual cohesion between c library, linkage editor ( linker), interpreter and operating system by porting the same on xv6 kernel
|
00001 // See MultiProcessor Specification Version 1.[14] 00002 00003 struct mp { // floating pointer 00004 uchar signature[4]; // "_MP_" 00005 void *physaddr; // phys addr of MP config table 00006 uchar length; // 1 00007 uchar specrev; // [14] 00008 uchar checksum; // all bytes must add up to 0 00009 uchar type; // MP system config type 00010 uchar imcrp; 00011 uchar reserved[3]; 00012 }; 00013 00014 struct mpconf { // configuration table header 00015 uchar signature[4]; // "PCMP" 00016 ushort length; // total table length 00017 uchar version; // [14] 00018 uchar checksum; // all bytes must add up to 0 00019 uchar product[20]; // product id 00020 uint *oemtable; // OEM table pointer 00021 ushort oemlength; // OEM table length 00022 ushort entry; // entry count 00023 uint *lapicaddr; // address of local APIC 00024 ushort xlength; // extended table length 00025 uchar xchecksum; // extended table checksum 00026 uchar reserved; 00027 }; 00028 00029 struct mpproc { // processor table entry 00030 uchar type; // entry type (0) 00031 uchar apicid; // local APIC id 00032 uchar version; // local APIC verison 00033 uchar flags; // CPU flags 00034 #define MPBOOT 0x02 // This proc is the bootstrap processor. 00035 uchar signature[4]; // CPU signature 00036 uint feature; // feature flags from CPUID instruction 00037 uchar reserved[8]; 00038 }; 00039 00040 struct mpioapic { // I/O APIC table entry 00041 uchar type; // entry type (2) 00042 uchar apicno; // I/O APIC id 00043 uchar version; // I/O APIC version 00044 uchar flags; // I/O APIC flags 00045 uint *addr; // I/O APIC address 00046 }; 00047 00048 // Table entry types 00049 #define MPPROC 0x00 // One per processor 00050 #define MPBUS 0x01 // One per bus 00051 #define MPIOAPIC 0x02 // One per I/O APIC 00052 #define MPIOINTR 0x03 // One per bus interrupt source 00053 #define MPLINTR 0x04 // One per system interrupt source 00054