Minor updates

This commit is contained in:
Steven James 2003-05-26 11:51:59 +00:00
commit 104154b48e
3 changed files with 31 additions and 9 deletions

View file

@ -24,7 +24,11 @@
char buffer[16];
extern struct stream rom_stream;
struct lb_memory *lbmem;
inline void reset(void)
{
outb(0x0e, 0xcf9);
}
int main(void) {
int blocks;
@ -35,10 +39,18 @@ int main(void) {
DPRINTF("Got lbmem struct: %08x\n", (unsigned int) lbmem);
if(choose_stream(&rom_stream) <0)
return(-1);
switch(choose_stream(&rom_stream)) {
case -1:
return(-1);
break;
case -2:
reset();
break;
elfboot(&rom_stream, preboot_param);
default:
elfboot(&rom_stream, preboot_param);
break;
}
}
outb(0x0e, 0x3f9);

View file

@ -16,10 +16,11 @@
#include <printk.h>
#include <serial_subr.h>
int stream_default=1;
int choose_stream(struct stream *stream)
{
int stream_count, i,j;
int stream_count, i,j,max;
tag_head *directory, *current;
if(stream->init() < 0) {
@ -50,7 +51,8 @@ int choose_stream(struct stream *stream)
current += current->block_count+1;
}
j=1;
max = j;
if(iskey()) {
j = ttys0_rx_char();
j=-1;
@ -58,6 +60,10 @@ int choose_stream(struct stream *stream)
while(j<0) {
printk_info("Choose a stream: ");
j = ttys0_rx_char();
if(j == 'r' || j == 'R')
return(-2);
if(j == 0x1b || j == 'x')
return(-1);
@ -65,12 +71,15 @@ int choose_stream(struct stream *stream)
printk_info(" INVALID RESPONSE\n");
j=-1;
} else
j-=0x30;
stream_default = (j-=0x30);
}
}
if(stream_default == max)
return(-2);
stream->load_tag(j);
stream->load_tag(stream_default);
stream_default++;
return(0);
}

View file

@ -676,6 +676,7 @@ int elfboot(struct stream *stream, pre_boot_param_t *param)
printk_err("Cannot Load ELF Image\n");
post_code(0xff);
return(-1);
}
return 0;