Basic VM and other minor improvements.

Not complete, probably not fully debugged or optimized.
This commit is contained in:
Ben Gras
2008-11-19 12:26:10 +00:00
parent c888305e21
commit c078ec0331
273 changed files with 10814 additions and 4305 deletions

View File

@@ -13,7 +13,7 @@ MAKE = exec make
CC = exec cc
CFLAGS = -I$i $(CPROFILE)
LDFLAGS = -i -L../libdriver_asyn
LIBS = -lsysutil -ldriver -lsys
LIBS = -ldriver -lsys
LIB_DEP = ../libdriver_asyn/libdriver.a
OBJ = log.o diag.o kputc.o
@@ -22,11 +22,11 @@ OBJ = log.o diag.o kputc.o
all build: $(DRIVER)
$(DRIVER): $(OBJ) $(LIB_DEP)
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
install -S 16kb $(DRIVER)
install -S 32kb $(DRIVER)
# install with other drivers
install: $(DRIVER)
install -o root -cs $? /sbin/$(DRIVER)
install -o root -cs $< /sbin/$(DRIVER)
# clean up local files
clean:

View File

@@ -11,11 +11,9 @@
#include <fcntl.h>
#include <minix/type.h>
#include <minix/safecopies.h>
#include <minix/sys_config.h>
#include "log.h"
#include "../../kernel/const.h"
#include "../../kernel/config.h"
#include "../../kernel/type.h"
/*==========================================================================*
* do_new_kmess *
@@ -24,8 +22,8 @@ PUBLIC int do_new_kmess(m)
message *m; /* notification message */
{
/* Notification for a new kernel message. */
struct kmessages kmess; /* entire kmess structure */
char print_buf[KMESS_BUF_SIZE]; /* copy new message here */
static struct kmessages kmess; /* entire kmess structure */
static char print_buf[_KMESS_BUF_SIZE]; /* copy new message here */
int bytes;
int i, r;
int *prev_nextp;
@@ -79,12 +77,12 @@ message *m; /* notification message */
* Check for size being positive, the buffer might as well be emptied!
*/
if (kmess.km_size > 0) {
bytes = ((kmess.km_next + KMESS_BUF_SIZE) - (*prev_nextp)) %
KMESS_BUF_SIZE;
bytes = ((kmess.km_next + _KMESS_BUF_SIZE) - (*prev_nextp)) %
_KMESS_BUF_SIZE;
r= *prev_nextp; /* start at previous old */
i=0;
while (bytes > 0) {
print_buf[i] = kmess.km_buf[(r%KMESS_BUF_SIZE)];
print_buf[i] = kmess.km_buf[(r%_KMESS_BUF_SIZE)];
bytes --;
r ++;
i ++;
@@ -136,5 +134,7 @@ PUBLIC int do_diagnostics(message *m, int safe)
}
log_append(diagbuf, i);
if(m->m_type == ASYN_DIAGNOSTICS) return EDONTREPLY;
return OK;
}

View File

@@ -9,8 +9,6 @@
#include "log.h"
#include <sys/time.h>
#include <sys/select.h>
#include "../../kernel/const.h"
#include "../../kernel/type.h"
#define LOG_DEBUG 0 /* enable/ disable debugging */
@@ -403,10 +401,10 @@ int safe;
r = do_diagnostics(m_ptr, 0);
break;
}
case DIAGNOSTICS_S: {
case ASYN_DIAGNOSTICS:
case DIAGNOSTICS_S:
r = do_diagnostics(m_ptr, 1);
break;
}
case DEV_STATUS: {
printf("log_other: unexpected DEV_STATUS request\n");
r = EDONTREPLY;