git: 9front

Download patch

ref: 0f1ca6027c8c11611bb767a43b20b02dcaa8fc40
parent: a4eeae411ad05fba4f6cb1c71a9c538d0587ae7f
author: cinap_lenrek <cinap_lenrek@localhost>
date: Sun May 15 10:34:37 EDT 2011

9boot: replace dots by printing 64k block number in hex

--- a/sys/src/boot/pc/fat.c
+++ b/sys/src/boot/pc/fat.c
@@ -144,7 +144,6 @@
 				if((fp->clust >> 4) == fat->eofmark)
 					return -1;
 				fp->lbaoff = (fp->clust - 2) * fat->clustsize;
-				putc('.');
 				fp->clust = readnext(fp, fp->clust);
 				fp->lba = fp->lbaoff + fat->datalba;
 			}
--- a/sys/src/boot/pc/sub.c
+++ b/sys/src/boot/pc/sub.c
@@ -85,13 +85,19 @@
 {
 	uchar *p, *e;
 
+	putc(' ');
 	p = data;
 	e = p + len;
 	while(p < e){
+		if(((ulong)p & 0xF000) == 0){
+			putc('\b');
+			putc(hex[((ulong)p>>16)&0xF]);
+		}
 		if((len = read(f, p, e - p)) <= 0)
 			break;
 		p += len;
 	}
+	putc('\b');
 	return p - (uchar*)data;
 }
 
@@ -110,7 +116,7 @@
 				putc(*p = getc());
 				if(*p == '\r')
 					putc('\n');
-				else if(*p == 0x08 && p > buf){
+				else if(*p == '\b' && p > buf){
 					p--;
 					continue;
 				}
@@ -149,6 +155,7 @@
 char *confend;
 
 static void apmconf(int);
+static void e820conf(void);
 
 char*
 configure(void *f, char *path)
@@ -159,7 +166,9 @@
 	kern = 0;
 	inblock = 0;
 
-	confend = (char*)BOOTARGS;
+	memset(BOOTLINE, 0, BOOTLINELEN);
+
+	confend = BOOTARGS;
 	memset(confend, 0, BOOTARGSLEN);
 Loop:
 	while((n = readline(f, line)) > 0){
@@ -187,6 +196,7 @@
 		*confend++ = '\n';
 		print(line); print(crnl);
 	}
+	e820conf();
 	*confend = 0;
 
 	if(f){
@@ -331,9 +341,11 @@
 	ulong n;
 	Exec ex;
 
-	e820conf();
+	print("boot");
+	print(crnl);
 
 	a20();
+
 	if(readn(f, &ex, sizeof(ex)) != sizeof(ex))
 		return "bad header";
 	if(beswal(ex.magic) != I_MAGIC)
@@ -342,16 +354,22 @@
 	e = (uchar*)(beswal(ex.entry) & ~0xF0000000UL);
 	t = e;
 	n = beswal(ex.text);
+
 	if(readn(f, t, n) != n)
 		goto Error;
 	d = (uchar*)PGROUND((ulong)t + n);
 	n = beswal(ex.data);
+
 	if(readn(f, d, n) != n)
 		goto Error;
 	close(f);
 	unload();
-	memset(BOOTLINE, 0, BOOTLINELEN);
+
+	print("go!");
+	print(crnl);
+
 	jump(e);
+
 Error:		
 	return "i/o error";
 }
--