diff -ru oskit-20020317-orig/examples/x86/GNUmakerules oskit-20020317-hacks-clean/examples/x86/GNUmakerules --- oskit-20020317-orig/examples/x86/GNUmakerules 2001-02-27 17:35:35.000000000 -0500 +++ oskit-20020317-hacks-clean/examples/x86/GNUmakerules 2002-08-02 13:41:06.000000000 -0400 @@ -30,7 +30,7 @@ TARGETS = hello multiboot timer timer_com timer_com2 stream_netio \ spf uspf pingreply diskpart diskpart2 blkio tty netbsd_fs_com \ netbsd_fs_posix fsread socket_com socket_com2 mouse memtest \ - memfs_com memfstest1 perfmon anno_test + memfs_com memfstest1 perfmon anno_test rndtest all: $(TARGETS) @@ -435,4 +435,13 @@ -loskit_clientos -loskit_kern -loskit_lmm \ $(CLIB) $(OBJDIR)/lib/crtn.o +rndtest: $(OBJDIR)/lib/multiboot.o rndtest.o bootp.o $(DEPENDLIBS) + $(OSKIT_QUIET_MAKE_INFORM) "Linking example $@" + $(LD) -Ttext 100000 $(LDFLAGS) $(OSKIT_LDFLAGS) \ + -o $@ $(filter-out %.a,$^) \ + -loskit_startup -loskit_clientos -loskit_bootp \ + -loskit_linux_dev -loskit_dev -loskit_kern -loskit_lmm \ + -loskit_random \ + $(CLIB) $(OBJDIR)/lib/crtn.o + endif Only in oskit-20020317-hacks-clean/examples/x86: rndtest.c diff -ru oskit-20020317-orig/linux/dev/GNUmakerules oskit-20020317-hacks-clean/linux/dev/GNUmakerules --- oskit-20020317-orig/linux/dev/GNUmakerules 2002-01-30 19:40:57.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/dev/GNUmakerules 2002-08-02 13:43:08.000000000 -0400 @@ -22,7 +22,8 @@ SRCDIRS += $(OSKIT_SRCDIR)/linux/dev \ $(OSKIT_SRCDIR)/linux/src/drivers/block \ $(OSKIT_SRCDIR)/linux/src/drivers/pci \ - $(OSKIT_SRCDIR)/linux/src/drivers/sound + $(OSKIT_SRCDIR)/linux/src/drivers/sound \ + $(OSKIT_SRCDIR)/linux/src/drivers/char ifeq ($(HOST_ARCH),arm32) # XXX hack for dma code diff -ru oskit-20020317-orig/linux/dev/block.h oskit-20020317-hacks-clean/linux/dev/block.h --- oskit-20020317-orig/linux/dev/block.h 1998-12-07 06:14:41.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/dev/block.h 2002-08-02 13:43:08.000000000 -0400 @@ -20,6 +20,7 @@ #include #include +#include /* * One of these structures exists for each @@ -62,6 +63,9 @@ /* The following members are set by blkdev_register() */ struct file_operations *fops; /* Linux file operations vector */ const char *name; /* Device name */ + + /* This gets set by probe_raw in linux/dev/ide.c */ + oskit_osenv_rpchannel_t *rpchannel_ref; }; extern struct device_struct blkdevs[]; diff -ru oskit-20020317-orig/linux/dev/ide.c oskit-20020317-hacks-clean/linux/dev/ide.c --- oskit-20020317-orig/linux/dev/ide.c 2000-10-13 17:56:07.000000000 -0400 +++ oskit-20020317-hacks-clean/linux/dev/ide.c 2002-08-02 13:43:09.000000000 -0400 @@ -27,11 +27,17 @@ #include #include #include +#include +#include #include "glue.h" #include "block.h" #include "osenv.h" +/* +++ DLD DEBUG FIXME */ +#include +/* --- DLD */ + static oskit_error_t probe(struct driver_struct *ds); /* Device driver structure representing the Linux IDE device driver */ @@ -273,8 +279,10 @@ static oskit_error_t probe_raw(struct driver_struct *ds) { static int initialized = 0; + oskit_osenv_randompool_t **randompool_aref; + oskit_osenv_rpchannel_t *rpchannel_ref = NULL; oskit_error_t rc; - int i, j, found; + int i, j, found, n_rp_dev; if (initialized) return 0; @@ -283,6 +291,18 @@ /* Call the Linux IDE probe code */ ide_init(); +#if 1 + /* See if the random pool has been registered */ + n_rp_dev = osenv_device_lookup(&oskit_osenv_randompool_iid, + (void ***)&randompool_aref); + if (n_rp_dev > 1) + panic("Too many random pool devices found!"); + + else if (n_rp_dev == 1) + printf("DLD: probe_raw() Got the random pool device!\n"); + else + printf("DLD: No random pool found.\n"); +#endif /* * Register each IDE device found in the hardware tree. * Each hardware interface becomes an IDE bus, @@ -331,8 +351,35 @@ rc = osenv_isabus_addchild( ide_hwifs[i].io_ports[IDE_DATA_OFFSET], (oskit_device_t*)&busi[i]); + + /* Attach to the random pool, if it's been registered, and + store it's emissary for later use + (see add_blkdev_randomness()) */ + if (randompool_aref[0]) + { + printf("IDE bus #%d attaching to random pool\n", i); + oskit_osenv_randompool_attach_source( + randompool_aref[0], + NULL, /* char *name */ + 0, /* oskit_u32_t type */ + 0, /* oskit_u32_t flags */ + &(blkdevs[ide_hwif_to_major[i]].rpchannel_ref)); + printf("storing rp channel %p for major %d\n", + blkdevs[ide_hwif_to_major[i]].rpchannel_ref, + ide_hwif_to_major[i]); + } } + /* Done with the randompool itself. All further communication + is via the rpchannel object stored in blkdevs . + */ + printf("blkdevs is %p\n", blkdevs); + if (n_rp_dev == 1) + { + oskit_osenv_randompool_release(randompool_aref[0]); + /*free(randompool_aref);*/ + } + return found; } diff -ru oskit-20020317-orig/linux/dev/irq.c oskit-20020317-hacks-clean/linux/dev/irq.c --- oskit-20020317-orig/linux/dev/irq.c 2000-08-22 12:46:37.000000000 -0400 +++ oskit-20020317-hacks-clean/linux/dev/irq.c 2002-08-02 13:43:10.000000000 -0400 @@ -112,6 +112,9 @@ if (bh_mask & bh_active) osenv_softirq_schedule(softintr_vector); + if (handlers[irq]->flags & SA_SAMPLE_RANDOM) + add_interrupt_randomness(irq); + linux_cli(); current = cur; diff -ru oskit-20020317-orig/linux/dev/misc.c oskit-20020317-hacks-clean/linux/dev/misc.c --- oskit-20020317-orig/linux/dev/misc.c 1999-11-10 19:53:10.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/dev/misc.c 2002-08-02 13:43:10.000000000 -0400 @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include "linux_emul.h" #include "osenv.h" @@ -104,10 +106,28 @@ return 0; } +#if 0 void add_blkdev_randomness (int major) { + printf("blkdevs is %p ", blkdevs); + if (blkdevs[major].rpchannel_ref) + { + printf("add_blkdev_randomness: maj %d has rp chan %p\n", + major, + blkdevs[major].rpchannel_ref); + { + oskit_u32_t time; + time = jiffies; + printf("calling add data with time %d\n", time); + oskit_osenv_rpchannel_add_data(blkdevs[major].rpchannel_ref, + &time, 1, 0); + } + } + else + printf("add_blkdev_randomness: major %d has no rp channel!\n", major); } +#endif int dev_get_info (char *buffer, char **start, off_t offset, int length, int dummy) diff -ru oskit-20020317-orig/linux/dev/net.c oskit-20020317-hacks-clean/linux/dev/net.c --- oskit-20020317-orig/linux/dev/net.c 2002-01-30 19:40:58.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/dev/net.c 2002-08-02 13:43:10.000000000 -0400 @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef HPFQ #include @@ -569,9 +570,24 @@ struct device *ldev; int found = 0; int rc; + oskit_osenv_randompool_t **randompool_aref; + int n_rp_dev; oskit_linux_net_init(); +#if 1 + /* See if the random pool has been registered */ + n_rp_dev = osenv_device_lookup(&oskit_osenv_randompool_iid, + (void ***)&randompool_aref); + if (n_rp_dev > 1) + panic("Too many random pool devices found!"); + + else if (n_rp_dev == 1) + printf("DLD: oskit_linux_netdev_probe_raw() Got the random pool device!\n"); + else + printf("DLD: No random pool found by oskit_linux_netdev_probe_raw().\n"); +#endif + osenv_log(OSENV_LOG_DEBUG, "Probing %s\n", ds->info.name); /* @@ -593,7 +609,12 @@ */ ldev = kmalloc(sizeof(*ldev) + 8, GFP_KERNEL); if (ldev == NULL) + { + if (n_rp_dev == 1) + oskit_osenv_randompool_release( + randompool_aref[0]); return OSKIT_E_OUTOFMEMORY; + } memset(ldev, 0, sizeof(*ldev)); ldev->name = (char*)(ldev + 1); @@ -649,7 +670,12 @@ */ dev = kmalloc(sizeof(*dev), GFP_KERNEL); if (dev == NULL) + { + if (n_rp_dev == 1) + oskit_osenv_randompool_release( + randompool_aref[0]); return OSKIT_E_OUTOFMEMORY; + } ldev->my_alias = dev; dev->ldev = ldev; dev->drv = drv; @@ -658,7 +684,20 @@ dev->send_ioi_count = 0; dev->recv_ioi = NULL; dev->openflags = 0; + dev->rpchannel_ref = NULL; + if (randompool_aref[0]) + { + printf("DLD: net dev %s attaching to random pool\n", + dev->ldev->name); + oskit_osenv_randompool_attach_source( + randompool_aref[0], + NULL, /* char *name */ + 0, /* oskit_u32_t type */ + 0, /* oskit_u32_t flags */ + &(dev->rpchannel_ref)); + } + /* * Register the fdev device node * in the device tree under the ISA bus. @@ -675,6 +714,12 @@ found++; } + if (n_rp_dev == 1) + { + printf("DLD: Releasing randompool\n"); + oskit_osenv_randompool_release(randompool_aref[0]); + } + return found; } diff -ru oskit-20020317-orig/linux/dev/net.h oskit-20020317-hacks-clean/linux/dev/net.h --- oskit-20020317-orig/linux/dev/net.h 2000-10-23 00:52:25.000000000 -0400 +++ oskit-20020317-hacks-clean/linux/dev/net.h 2002-08-02 13:43:10.000000000 -0400 @@ -22,6 +22,7 @@ #include #include +#include #include "glue.h" @@ -81,6 +82,7 @@ unsigned send_ioi_count; /* Reference count for send_ioi */ oskit_netio_t *recv_ioi; /* Imported net I/O intf for recv */ unsigned openflags; /* Stuff */ + oskit_osenv_rpchannel_t *rpchannel_ref; }; /* diff -ru oskit-20020317-orig/linux/src/drivers/block/ide.c oskit-20020317-hacks-clean/linux/src/drivers/block/ide.c --- oskit-20020317-orig/linux/src/drivers/block/ide.c 1999-11-10 19:53:16.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/src/drivers/block/ide.c 2002-08-02 13:43:13.000000000 -0400 @@ -450,6 +450,7 @@ rq = hwgroup->rq; if (!end_that_request_first(rq, uptodate, hwgroup->drive->name)) { + printf("hello from ide_end_request!"); add_blkdev_randomness(MAJOR(rq->rq_dev)); hwgroup->drive->queue = rq->next; blk_dev[MAJOR(rq->rq_dev)].current_request = NULL; Only in oskit-20020317-hacks-clean/linux/src/drivers: char diff -ru oskit-20020317-orig/linux/src/drivers/net/ne.c oskit-20020317-hacks-clean/linux/src/drivers/net/ne.c --- oskit-20020317-orig/linux/src/drivers/net/ne.c 1999-11-10 19:53:24.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/src/drivers/net/ne.c 2002-08-02 13:43:16.000000000 -0400 @@ -457,7 +457,9 @@ { int irqval = request_irq(dev->irq, ei_interrupt, - pci_irq_line ? SA_SHIRQ : 0, name, dev); + pci_irq_line ? + SA_SHIRQ | SA_SAMPLE_RANDOM : + SA_SAMPLE_RANDOM, name, dev); if (irqval) { printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval); kfree(dev->priv); diff -ru oskit-20020317-orig/linux/src/include/linux/blk.h oskit-20020317-hacks-clean/linux/src/include/linux/blk.h --- oskit-20020317-orig/linux/src/include/linux/blk.h 1999-11-10 19:54:29.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/src/include/linux/blk.h 2002-08-02 13:43:43.000000000 -0400 @@ -451,6 +451,7 @@ return; #ifndef DEVICE_NO_RANDOM + printf("DLD: Hello from end_request"); add_blkdev_randomness(MAJOR(req->rq_dev)); #endif DEVICE_OFF(req->rq_dev); diff -ru oskit-20020317-orig/linux/src/include/linux/ioctl.h oskit-20020317-hacks-clean/linux/src/include/linux/ioctl.h --- oskit-20020317-orig/linux/src/include/linux/ioctl.h 1996-07-22 00:51:03.000000000 -0400 +++ oskit-20020317-hacks-clean/linux/src/include/linux/ioctl.h 2002-08-02 13:43:46.000000000 -0400 @@ -1,7 +1,11 @@ #ifndef _LINUX_IOCTL_H #define _LINUX_IOCTL_H +#if 0 /* DLD */ #include +#else +#include +#endif #endif /* _LINUX_IOCTL_H */ diff -ru oskit-20020317-orig/linux/src/include/linux/random.h oskit-20020317-hacks-clean/linux/src/include/linux/random.h --- oskit-20020317-orig/linux/src/include/linux/random.h 1999-11-10 19:54:56.000000000 -0500 +++ oskit-20020317-hacks-clean/linux/src/include/linux/random.h 2002-08-02 13:43:50.000000000 -0400 @@ -7,7 +7,11 @@ #ifndef _LINUX_RANDOM_H #define _LINUX_RANDOM_H +#if 0 /* DLD */ #include +#else +#include +#endif /* ioctl()'s for the random number generator */ @@ -35,7 +39,11 @@ struct rand_pool_info { int entropy_count; int buf_size; +#if 0 /* DLD */ __u32 buf[0]; +#else + oskit_u32_t buf[0]; +#endif }; /* Exported functions */ diff -ru oskit-20020317-orig/modules.x86.pc oskit-20020317-hacks-clean/modules.x86.pc --- oskit-20020317-orig/modules.x86.pc 2002-03-12 12:38:48.000000000 -0500 +++ oskit-20020317-hacks-clean/modules.x86.pc 2002-08-02 13:40:52.000000000 -0400 @@ -202,6 +202,9 @@ ## Requires the udp library. #netdisk +### The random number stuff. +random + ### --- Scripts and build/debug utilities ### Includes the CPU-oskit-gcc wrapper. Only in oskit-20020317-hacks-clean/oskit/dev: #rpnoblock.h# diff -ru oskit-20020317-orig/oskit/dev/linux_ethernet.h oskit-20020317-hacks-clean/oskit/dev/linux_ethernet.h --- oskit-20020317-orig/oskit/dev/linux_ethernet.h 2000-11-10 16:59:49.000000000 -0500 +++ oskit-20020317-hacks-clean/oskit/dev/linux_ethernet.h 2002-08-02 20:05:04.000000000 -0400 @@ -44,12 +44,26 @@ #ifdef OSKIT_ARM32_SHARK driver(cs89x0, "Crystal Semiconductor CS89[02]0", NULL, "Russell Nelson", "cs89x0", cs89x0_probe) #else + +#if 0 /* DLD */ + driver(lance, "LANCE", "AMD", "Donald Becker", "lance", lance_probe) driver(vortex, "3Com 3c590/3c595 \"Vortex\"", "3Com", "Donald Becker", "3c59x", tc59x_probe) driver(epic100, "SMC EPIC/100 83C170", "SMC", "Donald Becker", "epic100", epic100_probe) driver(seeq8005, "SEEQ 8005", NULL, "Donald Becker", "seeq8005", seeq8005_probe) +#endif + + /* for neckhug */ driver(tulip, "DEC 21040", "Digital Equipment Corporation", "Donald Becker", "tulip", tulip_probe) + + /* for neura */ +driver(ne, "NE1000, NE2000", NULL, "Donald Becker", "ne", ne_probe) + + /* this is because there's a compile error without it */ driver(eepro100, "Intel i82557", "Intel", "Donald Becker", "eepro100", eepro100_probe) + +#if 0 + driver(hp100, "Hewlett Packard HP10/100VG ANY LAN", "Hewlett Packard", "Jaroslav Kysela", "hp100", hp100_probe) driver(ultra, "SMC Ultra and SMC EtherEZ ISA", "SMC", "Donald Becker", "smc-ultra", ultra_probe) driver(smc9194, "SMC 9000 series", "SMC", "Erik Stahlman", "smc9194", smc_init) @@ -58,7 +72,11 @@ driver(hp, "HP LAN", "Hewlett Packard", "Donald Becker", "hp", hp_probe) driver(hpplus, "HP PC-LAN/plus", "Hewlett Packard", "Donald Becker", "hp-plus", hp_plus_probe) driver(ac3200, "Ansel Communications EISA", "Ansel Communications", "Donald Becker", "ac3200", ac3200_probe) -driver(ne, "NE1000, NE2000", NULL, "Donald Becker", "ne", ne_probe) + +#endif + +#if 0 + /* XXX: This probe crashes our NE2000 cards, hanging the machine. */ /* Make sure it's called _after_ the ne probe. */ driver(e2100, "Cabletron E2100", "Cabletron", "Donald Becker", "e2100", e2100_probe) @@ -78,3 +96,4 @@ driver(ni52, "NI5210", NULL, "Michael Hipp", "ni52", ni52_probe) driver(ni65, "NI6510", NULL, "Michael Hipp", "ni65", ni65_probe) #endif +#endif diff -ru oskit-20020317-orig/oskit/dev/linux_scsi.h oskit-20020317-hacks-clean/oskit/dev/linux_scsi.h --- oskit-20020317-orig/oskit/dev/linux_scsi.h 1999-11-10 19:42:38.000000000 -0500 +++ oskit-20020317-hacks-clean/oskit/dev/linux_scsi.h 2002-08-02 13:44:08.000000000 -0400 @@ -36,6 +36,7 @@ #ifdef OSKIT_ARM32_SHARK #else +#if 0 driver(ncr53c8xx, "NCR53c8xx (rel 1.12d)", "NCR", "Wolfgang Stanglmeier", "ncr53c8xx", NCR53C8XX) driver(ncr53c7xx, "NCR53c{7,8}xx (rel 17)", "NCR", "Drew Eckhardt", "53c7,8xx", NCR53c7xx) driver(am53c974, "AM53C974", NULL, "Drew Eckhardt, Robin Cutshaw, D. Frieauff", "AM53C974", AM53C974) @@ -61,3 +62,4 @@ driver(ultrastor, "UltraStor 14F/24F/34F", "UltraStor", "David B. Gentzel, Whitfield Software Services", "ultrastor", ULTRASTOR_14F) driver(wd7000, "Western Digital WD-7000", "Western Digital", "Thomas Wuensche, Tommy Thorn, John Boyd", "wd7000", WD7000) #endif +#endif Only in oskit-20020317-hacks-clean/oskit/dev: randompool.h Only in oskit-20020317-hacks-clean/oskit/dev: rpchannel.h Only in oskit-20020317-hacks-clean/oskit/dev: rpgood.h Only in oskit-20020317-hacks-clean/oskit/dev: rpnoblock.h Only in oskit-20020317-hacks-clean/oskit/dev: rpstats.h diff -ru oskit-20020317-orig/oskit/fs/linux_filesystems.h oskit-20020317-hacks-clean/oskit/fs/linux_filesystems.h --- oskit-20020317-orig/oskit/fs/linux_filesystems.h 1999-11-10 19:56:10.000000000 -0500 +++ oskit-20020317-hacks-clean/oskit/fs/linux_filesystems.h 2002-08-02 13:44:09.000000000 -0400 @@ -34,14 +34,24 @@ * indent them a space. */ +#if 0 filesystem(ufs, "UFS filesystem", init_ufs_fs) +#endif + filesystem(ext2, "Second extended filesystem", init_ext2_fs) filesystem(minix, "Minix filesystem", init_minix_fs) + +#if 0 filesystem(vfat, "VFAT (Win95) filesystem", init_vfat_fs) filesystem(msdos, "MSDOS filesystem", init_msdos_fs) +#endif + filesystem(fat, "DOS FAT filesystem", init_fat_fs) filesystem(isofs, "ISO9660 CDROM filesystem", init_iso9660_fs) + +#if 0 filesystem(sysv, "System V and Coherent filesystems", init_sysv_fs) filesystem(hpfs, "OS/2 HPFS filesystem (read only)", init_hpfs_fs) filesystem(affs, "Amiga FFS filesystem", init_affs_fs) /* filesystem(ntfs, "WinNT NTFS filesystem support (read only)", init_ntfs_fs) */ +#endif Only in oskit-20020317-hacks-clean: random diff -ru oskit-20020317-orig/startup/start_devices.c oskit-20020317-hacks-clean/startup/start_devices.c --- oskit-20020317-orig/startup/start_devices.c 2000-11-02 17:21:16.000000000 -0500 +++ oskit-20020317-hacks-clean/startup/start_devices.c 2002-08-02 13:44:18.000000000 -0400 @@ -30,7 +30,7 @@ #include #ifdef DEBUG -static int verbose = 1; +static int verbose = 0; /* DLD 1;*/ #else static int verbose = 0; #endif diff -ru oskit-20020317-orig/unix/elf/crt1.c oskit-20020317-hacks-clean/unix/elf/crt1.c --- oskit-20020317-orig/unix/elf/crt1.c 2001-03-27 17:51:09.000000000 -0500 +++ oskit-20020317-hacks-clean/unix/elf/crt1.c 2002-08-02 13:44:23.000000000 -0400 @@ -83,7 +83,7 @@ #endif char **environ; -char *__progname; +char *__progname ; void _start(char *arguments, ...) diff -ru oskit-20020317-orig/unix/linux/sbrk-hack.c oskit-20020317-hacks-clean/unix/linux/sbrk-hack.c --- oskit-20020317-orig/unix/linux/sbrk-hack.c 2000-03-04 19:38:55.000000000 -0500 +++ oskit-20020317-hacks-clean/unix/linux/sbrk-hack.c 2002-08-02 13:44:24.000000000 -0400 @@ -17,4 +17,6 @@ /* This is needed to prevent the horrifying `init-first.o' being linked in from libc.a on Linux/glibc. */ +#if 0 int __libc_multiple_libcs = 0; +#endif