#include "u.h" #include "../port/lib.h" #include "mem.h" #include "dat.h" #include "fns.h" #define MAXCONF 64 static char *confname[MAXCONF]; static char *confval[MAXCONF]; static int nconf; /* screen.c */ extern char* rgbmask2chan(char *buf, int depth, u32int rm, u32int gm, u32int bm); /* vgavesa.c */ extern char* vesabootscreenconf(char*, char*, uchar*); static void multibootargs(void) { extern ulong multibootptr; ulong *multiboot; char *cp, *ep, *s; ulong *m, l; int i, n; if(multibootptr == 0 || multibootptr >= MemMin) return; multiboot = (ulong*)KADDR(multibootptr); cp = BOOTARGS; ep = cp + BOOTARGSLEN-1; /* memory map */ if((multiboot[0] & (1<<6)) != 0 && (l = multiboot[11]) >= 24){ cp = seprint(cp, ep, "*e820="); m = KADDR(multiboot[12]); while(m[0] >= 20 && m[0]+4 <= l){ uvlong base, size; m++; base = ((uvlong)m[0] | (uvlong)m[1]<<32); size = ((uvlong)m[2] | (uvlong)m[3]<<32); cp = seprint(cp, ep, "%.1lux %.16llux %.16llux ", m[4] & 0xF, base, base+size); l -= m[-1]+4; m = (ulong*)((uintptr)m + m[-1]); } cp[-1] = '\n'; } if((multiboot[0] & (1<<12)) != 0 && multiboot[22] != 0){ /* framebuffer */ uchar *p = (uchar*)multiboot + 112; int depth = multiboot[27] & 0xFF; char chan[32]; switch((multiboot[27]>>8) & 0xFF){ case 0: snprint(chan, sizeof chan, "m%d", depth); if(0){ case 1: rgbmask2chan(chan, depth, (1UL<
0 && multiboot[6] != 0){
m = KADDR(multiboot[6]);
s = (char*)KADDR(m[0]);
if(m[1] > m[0]){
n = utfnlen(s, m[1] - m[0]);
if(n > 0)
cp = seprint(cp, ep, "%.*s\n", n, s);
}
}
/* command line */
if((multiboot[0] & (1<<2)) != 0 && multiboot[4] != 0){
n = tokenize(KADDR(multiboot[4]), confval, MAXCONF);
for(i=0; i