|
From: Russ D. <ru...@us...> - 2001-09-02 02:29:57
|
Update of /cvsroot/blob/blob/src
In directory usw-pr-cvs1:/tmp/cvs-serv2911/src
Modified Files:
main.c memory.c param_block.c
Log Message:
paramater block cleanups
Index: main.c
===================================================================
RCS file: /cvsroot/blob/blob/src/main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- main.c 2001/08/31 06:26:59 1.4
+++ main.c 2001/09/02 02:29:54 1.5
@@ -100,17 +100,17 @@
blob_status.load_ramdisk = 1;
blob_status.cmdline[0] = '\0';
blob_status.boot_delay = 10;
+ SerialInit(blob_status.terminalSpeed);
+
+ /* get the amount of memory */
+ get_memory_map();
+ TimerInit();
+
/* Parse the paramater block */
#ifdef PARAM_START
parse_ptags((void *) PARAM_START);
#endif
-
- /* We really want to be able to communicate, so initialise the
- * serial port at 9k6 (which works good for terminals)
- */
- SerialInit(blob_status.terminalSpeed);
- TimerInit();
/* Print the required GPL string */
SerialOutputString("\nConsider yourself LARTed!\n\n");
@@ -126,10 +126,11 @@
SerialOutputString("under certain conditions; "
"read the GNU GPL for details.\n");
-
- /* get the amount of memory */
- get_memory_map();
-
+ /* Paramater block parsing can change the baud rate. get_memory_map
+ * can destroy things that parse_ptags does, So break up the
+ * memory make detection/display */
+ show_memory_map();
+
/* Load kernel and ramdisk from flash to RAM */
Reload("blob");
Reload("kernel");
Index: memory.c
===================================================================
RCS file: /cvsroot/blob/blob/src/memory.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- memory.c 2001/08/06 22:44:52 1.2
+++ memory.c 2001/09/02 02:29:54 1.3
@@ -99,7 +99,12 @@
i++;
}
}
+}
+
+void show_memory_map(void)
+{
+ int i;
SerialOutputString("Memory map:\n");
for(i = 0; i < NUM_MEM_AREAS; i++) {
if(memory_map[i].used) {
Index: param_block.c
===================================================================
RCS file: /cvsroot/blob/blob/src/param_block.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- param_block.c 2001/08/31 06:26:59 1.1
+++ param_block.c 2001/09/02 02:29:54 1.2
@@ -85,6 +85,7 @@
static int parse_ptag_baud(const struct ptag *ptag)
{
blob_status.terminalSpeed = ptag->u.baud.terminal;
+ SerialInit(blob_status.terminalSpeed);
blob_status.downloadSpeed = ptag->u.baud.download;
return 0;
}
@@ -120,7 +121,8 @@
if (t->hdr.ptag == PTAG_CORE) {
for (; t->hdr.size; t = ptag_next(t)) {
if (t < (struct ptag *) PARAM_START ||
- t > (struct ptag *) (PARAM_START + PARAM_LEN)) {
+ t > (struct ptag *) (PARAM_START + PARAM_LEN) ||
+ t->hdr.size > 0x7FFFFFFF) {
return; /* corrupt tags */
}
if (!parse_ptag(t)) { /* Ignoring unrecognised tag */ }
|