diff options
| author | aiju <aiju@phicode.de> | 2012-07-13 18:52:39 +0200 |
|---|---|---|
| committer | aiju <aiju@phicode.de> | 2012-07-13 18:52:39 +0200 |
| commit | c612f9c41fd876c181f89472861245404cef65c5 (patch) | |
| tree | 030d0acc8463b3c410420ffd44072b8bf633b6ef | |
| parent | c03913c62ddb751d2992e8a3d70e945229ed8e15 (diff) | |
| download | plan9front-c612f9c41fd876c181f89472861245404cef65c5.tar.xz | |
multiboot: use initrd for config
| -rw-r--r-- | sys/src/9/pc/l.s | 10 | ||||
| -rw-r--r-- | sys/src/9/pc/main.c | 16 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sys/src/9/pc/l.s b/sys/src/9/pc/l.s index 128fde3d3..83e6e91a3 100644 --- a/sys/src/9/pc/l.s +++ b/sys/src/9/pc/l.s @@ -52,6 +52,10 @@ TEXT _multibootheader(SB), $0 LONG $0 /* height */ LONG $0 /* depth */ +/* + * the kernel expects the data segment to be page-aligned + * multiboot bootloaders put the data segment right behind text + */ TEXT _multibootentry(SB), $0 MOVL $etext-KZERO(SB), SI MOVL SI, DI @@ -64,10 +68,16 @@ TEXT _multibootentry(SB), $0 STD REP; MOVSB CLD + ADDL $KZERO, BX + MOVL BX, multiboot-KZERO(SB) MOVL $_startPADDR(SB), AX ANDL $~KZERO, AX JMP* AX +/* multiboot structure pointer */ +TEXT multiboot(SB), $0 + LONG $0 + /* * In protected mode with paging turned off and segment registers setup * to linear map all memory. Entered via a jump to PADDR(entry), diff --git a/sys/src/9/pc/main.c b/sys/src/9/pc/main.c index 1ea96d6c7..71c469650 100644 --- a/sys/src/9/pc/main.c +++ b/sys/src/9/pc/main.c @@ -37,6 +37,22 @@ options(void) { long i, n; char *cp, *line[MAXCONF], *p, *q; + ulong *m, l; + extern ulong *multiboot; + + if(multiboot != nil){ + cp = BOOTARGS; + *cp = 0; + if((*multiboot & 8) != 0 && multiboot[5] > 0){ + m = KADDR(multiboot[6]); + l = m[1] - m[0]; + m = KADDR(m[0]); + if(l >= BOOTARGSLEN) + l = BOOTARGSLEN - 1; + memmove(cp, m, l); + cp[l] = 0; + } + } /* * parse configuration args from dos file plan9.ini |
