From: Thomas F. <tf...@no...> - 2004-02-16 08:27:05
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Dan, thanks for the patch this solved the issue with the CO_TERMINATE_INVALID_OPERATION errors. I can now build the kernel and get system time from host operation system. Thanks, Thomas > Thaks, the patch I made below completes your effort. > > This patch also fixes at least one invalid operation (termination 7) > problem > that was encountered. It turns out that time.c was trying to query the > BIOS > directly for the system time and therefore was stopped by co_terminate(). > In > the next release, it would get this information from the host OS using a > special interface. For now, the patch below adds devfs support and > addresses > the invalid operation problem alone. > > (applies on top of 0.5.3-pre2's patch/linux) > > diff -u linux/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c > --- linux/arch/i386/kernel/time.c 2003-12-13 17:17:01.000000000 +0200 > +++ linux/arch/i386/kernel/time.c 2004-02-14 01:50:50.000000000 +0200 > @@ -121,6 +121,8 @@ > > extern spinlock_t i8259A_lock; > > +#ifndef CONFIG_COOPERATIVE > + > #ifndef CONFIG_X86_TSC > > /* This function must be called with interrupts disabled > @@ -254,6 +256,18 @@ > return count; > } > > +#else > + > +static unsigned long do_slow_gettimeoffset(void) > +{ > + /* > + * coLinux TODO for 0.5.3: Request the time from the host OS. > + */ > + return 0; > +} > + > +#endif > + > static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset; > > > diff -u linux/drivers/block/cobd.c linux/drivers/block/cobd.c > --- linux/drivers/block/cobd.c 2004-02-06 17:11:19.000000000 +0200 > +++ linux/drivers/block/cobd.c 2004-02-14 01:30:47.000000000 +0200 > @@ -10,6 +10,8 @@ > #include <linux/errno.h> > #include <linux/major.h> > #include <linux/slab.h> > +#include <linux/devfs_fs_kernel.h> > + > > #define MAJOR_NR COLINUX_MAJOR > #define DEVICE_NR(device) MINOR(device) /* has no partition bits */ > @@ -19,6 +21,7 @@ > #define DEVICE_OFF(d) /* do-nothing */ > > #include <linux/blk.h> > +#include <linux/blkpg.h> > #include <linux/hdreg.h> > #include <linux/cooperative.h> > > @@ -231,10 +234,14 @@ > for (i=0; i < cobd_devs; i++) > register_disk(NULL, MKDEV(MAJOR_NR, i), 1, &cobd_fops, cobd_sizes[i]); > > - printk("cobd driver initialized\n"); > + devfs_register_series(NULL, "cobd%u", cobd_devs, > DEVFS_FL_DEFAULT, > + MAJOR_NR, 0, > + S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, > + &cobd_fops, NULL); > + > + printk("cobd: loaded (max %d devices)\n", cobd_devs); > > - result = 0; > - return result; > + return 0; > > fail_malloc_2: > kfree(cobd_blksizes); > @@ -242,6 +249,9 @@ > kfree(cobd_sizes); > fail_malloc: > > + if (devfs_unregister_blkdev(MAJOR_NR, "cobd")) > + printk(KERN_WARNING "loop: cannot unregister blkdev\n"); > + > return result; > } > > @@ -262,0 +273 @@ > + > diff -u linux/include/asm-i386/io.h linux/include/asm-i386/io.h > --- linux/include/asm-i386/io.h 2004-02-08 00:43:12.000000000 +0200 > +++ linux/include/asm-i386/io.h 2004-02-14 01:50:28.000000000 +0200 > @@ -124,8 +124,7 @@ > static inline void * ioremap (unsigned long offset, unsigned long size) > { > #ifdef CONFIG_COOPERATIVE > - co_debug("ioremap %x:%d\n", offset, size); > - co_terminate(CO_TERMINATE_INVALID_OPERATION); > + panic("ioremap %ld:%ld\n", offset, size); > #endif > return __ioremap(offset, size, 0); > } > @@ -153,8 +152,7 @@ > static inline void * ioremap_nocache (unsigned long offset, unsigned long > size) > { > #ifdef CONFIG_COOPERATIVE > - co_debug("ioremap %x:%d\n", offset, size); > - co_terminate(CO_TERMINATE_INVALID_OPERATION); > + panic("ioremap_nocache %ld:%ld\n", offset, size); > #endif > return __ioremap(offset, size, _PAGE_PCD); > } > @@ -443,7 +441,9 @@ > > static inline unsigned long badio(const char *file, int line) > { > - co_terminate(CO_TERMINATE_INVALID_OPERATION); > +#ifdef CONFIG_COOPERATIVE > + panic("badio %s:%d\n", file, line); > +#endif > return 0; > } > > > > > -- > Dan Aloni > da...@gm... > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > coLinux-devel mailing list > coL...@li... > https://lists.sourceforge.net/lists/listinfo/colinux-devel > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAMH8+nwJBIFTVIqwRArxYAJ9z59DXlGfgOkKCFLWOINx2YsS0hwCgprcz +384TzRrxUFmauWS3FZIiGQ= =8egT -----END PGP SIGNATURE----- |