Skip to contentSkip to conversation

Bugs in mini-os on i386 architecture

PATCH Melvin Anderson 2 participants 2 messages Mar 20, 2006 – Mar 23, 2006

lore
Share & tools
lore
#0 lore raw

I have been trying to get mini-os to run on i386 architecture, (xen-unstable.hg, 9325:1ecb7f1ddc79) but have hit problems:

-- header file extras/mini-os/include/console.h is missing,

-- type mismatch in extras/mini-os/xenbus/xenbus_xs.c causes compile
to fail, and

-- page fault occurs in extras/mini-os/mm.c because page directory table
entries are set up incorrectly. The array mmu_updates in new_pt_frame() has zero entries, but should have at least 1 entry.

I wonder if whoever is actively working on mini-os could review these patches, and merge them in to the sources. The header file console.h contains the minimum amount needed to get mini-os to compile -- the writer of console.c may have intended it to contain more.

Regards,

Melvin Anderson.

extras/mini-os/mm.c +1 -1
diff -r 1ecb7f1ddc79 extras/mini-os/mm.c
@@ -373,7 +373,7 @@
     unsigned long *tab = (unsigned long *)start_info.pt_base;
     unsigned long pt_page = (unsigned long)pfn_to_virt(*pt_pfn); 
     unsigned long prot_e, prot_t, pincmd;
-    mmu_update_t mmu_updates[0];
+    mmu_update_t mmu_updates[1];
     struct mmuext_op pin_request;
     
     DEBUG("Allocating new L%d pt frame for pt_pfn=%lx, "
extras/mini-os/xenbus/xenbus_xs.c +1 -1
diff -r 1ecb7f1ddc79 extras/mini-os/xenbus/xenbus_xs.c
@@ -335,7 +335,7 @@
 		  const char *dir, const char *node)
 {
 	char **d;
-	int dir_n;
+	unsigned int dir_n;
 
 	d = xenbus_directory(t, dir, node, &dir_n);
 	if (IS_ERR(d))
extras/mini-os/include/console.h new file +15 -0
diff -r 1ecb7f1ddc79 extras/mini-os/include/console.h
@@ -0,0 +1,15 @@
+/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*- */
+
+#ifndef _CONSOLE_H_
+#define _CONSOLE_H_
+
+#include <stdarg.h>
+#include <traps.h>
+
+void printk(const char *fmt, ...);
+void xencons_rx(char *, unsigned, struct pt_regs *);
+void xencons_tx(void);
+
+
+
+#endif /* _CONSOLE_H_ */

--

Melvin Anderson, Trusted Systems Laboratory, HPLabs, Bristol.

#1 lore raw
Quoted 3 lines

I have been trying to get mini-os to run on i386 architecture, (xen-unstable.hg, 9325:1ecb7f1ddc79) but have hit problems:

-- header file extras/mini-os/include/console.h is missing,

A patch has just been sent out to the list. Thanks for pointing that out.

Quoted 2 lines

-- type mismatch in extras/mini-os/xenbus/xenbus_xs.c causes compile
to fail, and

XenBus implementation got replaced with a new one by Steven Smith. This should therefore not be an issue any more.

Quoted 3 lines

-- page fault occurs in extras/mini-os/mm.c because page directory table
entries are set up incorrectly. The array mmu_updates in new_pt_frame() has zero entries, but should have at least 1 entry.

The last patch fixes that as well.

Quoted 1 line

I wonder if whoever is actively working on mini-os could review these patches, and merge them in to the sources. The header file console.h contains the minimum amount needed to get mini-os to compile -- the writer of console.c may have intended it to contain more.

What you've put there is almost everything (only relevant change was addition of the license).

Thanks for help Malvin!

Cheers
Gregor