rminnichmerge57758a716 years agoHistory
43 lines · 881 B · Text
RawDownload
archbgp.c: /* This will move when the kmap stuff is finished *//* For now load custom boot script from ramdisk location */#define RAMDISK_LOC 0x01000000#define RAMDISK_MAGIC 0xb00f43ad#define RAMDISK_MAX 8192char arch_ramdisk[8192];voidramdisk(void){	void *addr = (void *)(KSEG0|RAMDISK_LOC);	ulong magic = *((ulong *) addr);	ulong size = *((ulong *) addr + 1);		if(magic != RAMDISK_MAGIC)		snprint(arch_ramdisk, RAMDISK_MAX, "# bad ramdisk magic: %8.8lux size: %lud\n\0", magic, size);	else {		if(size > RAMDISK_MAX)			size = RAMDISK_MAX;		memmove(arch_ramdisk, (uchar *)addr+8, size);	}} devarch.c: static longscriptread(Chan*, void* a, long n, vlong offset){		extern char arch_ramdisk[]; 	if(offset+n > 8192)		n = 8192-offset; 	if(n<0)		return 0; 	return readstr(offset, a, n, arch_ramdisk);} ... 	addarchfile("script", 0555, scriptread, nil);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t