Fri Oct 13 14:16:53 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * lis.install: Added step 0. to make a backup of changed files (they're copied to .DIST files). Sat Oct 7 04:58:59 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * (drivers): Now streams drivers are under drivers/str/ so we could unpack them in place under /usr/src/linux. Sat Oct 7 03:25:13 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * drivers/: major number have to be numbered folowing the host kernel convention. In the Linux kernel they're defined in include/linux/major.h. I've added major numbers there for loopback driver and streams fifos. Add any other major number there. LiS devices are created with plain mknod, no special magic is needed. * More fixes and lis module (un)loading tested with Linux 1.2.13 Fri Sep 29 13:14:29 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * INSTALL: Added this file a quick-how-to build LiS w/ a Linux kernel. * Every symlink is deleted. head headers are in include/sys/LiS, not in the head and linked again from include/sys/LiS. There's just a include/sys directory and not an include/linux (NOTE: this link was to make <linux/...> includes try first w/ LiS ones and then with Linux ones). * include/sys/LiS/share.h: now this includes strport which in turn includes linux-mdep.h. * include/sys/strport.h: This was almost the same thing that mdep.h, so I've changed strport.h to be a big if-if-if file selecting one mdep.h file; mdep now is dos-mdep.h or linux-mdep.h or ... w/ stuff to port LiS to a dos testing env. or Linux kernel or ... Wed Sep 27 14:42:34 1995 Francisco J. Ballesteros Camara <fcamara@rueda> * Merging changes to make LiS a loadable module (kmodule.patch.tgz) from Denis Froschauer: Denis Froschauer 100741.1151@compuserve.com wrote after making LiS become a Linux loadable module: -------------------------------------------------- 95/09/26 1. General considerations I have ftp'ed your sources September, 20 and made changes to make a linux loadable module. At this time, the module lis.o (copied in /lib/modules/<version>/misc) can be loaded by 'modprobe lis' and unloaded by 'modprobe -r lis'. I think its very easy to debug and test (... on my slow 386 25). I have tested anything but load and unload module. The kernel version I'm working is 1.2.13. I have read your archive in /usr/src/linux (this is where I compile my Linuxes). I have not understoud your symbolic link linux -> sys and sys/linux -> sys/linux. I have removed him. I have'nt use your root Makefile but I have modified the Linux root Makefile to scan the head directory. I send to you the file diffLiS.gz made with : 'diff -cr head.orig head' in /incoming of your ftp site. Please check on my changes. I'm sure that some of these changes are not the best. ------------------------------------------------------------ 2. Changes in directory /usr/src/linux/include/sys * sysmacros.h removed because it is selected instead of the linux/sysmacros.h which contain the defines minor() and major() * strport.h : added #include <linux/modules> and #include <linux/version.h> in the top, for make LiS a Linux module. * stropts.h : STR define remplaced by STRIOC to avoid redefinition. ------------------------------------------------------------ 3. Changes in directory /usr/src/linux/head * In each C source, I have included strport.h in the top, for make LiS a module. * Makefile changed to support modules conditional compilation flags '-DMODULES -DCONFIG_MODVERSIONS' and '-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer' flags like other kernel parts and -DLiS. * buffcall.c : few modification to avoid warnings due to -Wall * buffcall.h : idem * errmsg.c : idem * events.c : macro MALLOC used instead of ALLOC * head.c : the big stuff !! - declaration of 'current' not made (I think) by any .h - some unused variables - uninitialised pointers. I have made changes when I can. - S_ISDEV replaced by S_ISCHR - some little errors like allob() called insted of allocb() - some functions calls not prefixed by lis_ - some tests <0 with uint variable - arguments band and flags inverted in lis_strputpmsg (cf. DDI/DKI guide) - idem for lis_strgetpmsg * head.h : changes reflecting changes in head.c * mdep.c : I suppose mdep is 'machine dependant'. So I move the file_operation structure here. __get_free_page changed in get_free_page * mdep.h : removed #include <linux/modules.h> now in strport.h * mod.c : changes to register a Streams driver. May be we have to register it to character drivers subsystem ? I'm not sure. * msg.c : drv_usectohz() function not found anywhere. I replace it by 100. * msg.h : changes for -Wstrict-prototypes * msgutl.c : I don't find MEMCPY anywhere. replace by memcpy. * poll.c : lis_syspoll() moved in syscalls.c * queue.c : inline functions contained in queue.h are moved here. They made unresolved symbols when the module is loaded into the kernel. * stream.c : struct file_operations moved in mdep.c and system calls moved in syscalls.c * wait.c : inline functions contained in wait.h are moved here. They made unresolved symbols when the module is loaded into the kernel. * syscalls.c : NEW FILE compiled separately and linked with the kernel. ------------------------------------------------------------ 4. Changes in Linux to install new system calls All changes are prefixed by '#ifdef LiS' . * Makefile * arch/i386/kernel/entry.S * include/asm/unistd.h * include/linux/unistd.h * include/linux/fs.h : added putpmsg and getpmsg in file_operations structure. ------------------------------------------------------------ 5. TODO * think how must be numbered Streams drivers (major numbers) * how to create devices special files * write a dummy Streams driver as a Linux module and test the loading, registration in LiS. * first tests with open, read, write, close on this driver. * add the three new syscalls in libc * write the very important 'clone'. * study the internal connexion between select() and lis_poll(). I think that LiS must be an open system to applications that already manage devices with select() like sockets, ttys. Wed Sep 27 09:20:08 1995 Francisco J. Ballesteros Camara <nemo@nautilus> * mdep.h (splstr/splx): now these two macros take one int argmument (the psw) for the sake of portability. Such macros are defined for linux just to inc/dec a global counter. When the counter gets to zero we do an sti() and when it becomes 1 we do a cli() Thu Sep 21 11:25:32 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * (head): incomplete files as of today are: stream.c: init & termination queue.c: few routines to be implemented (band handling) head.c: just more features to be implemented (including poll & passfd) poll.c: should be considered as not implemented Sat Aug 5 17:39:29 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * head/head.c (copyout_blks): should be unified w/ copyout_msg() (really??) (lis_init_head): iocseq should be initialized w/ some random value to avoid problems in the future. Fri Sep 9 01:40:49 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * head/head.c (has_ioc_res): M_IOC* and M_COPY* should have a bit pattern such that this function could be implemented by means of binary `&'. (beware that any other M_* could be using the same trick, so dont change M_* tag values w/o ensuring nothing else gets broken). Wed Sep 6 14:10:30 1995 Francisco J. Ballesteros <nemo@nautilus.uc3m.es (Francisco J. Ballesteros)> * head/stream.c (queuerun): STREAMS scheduling doesn't seems to be too fine. Should redesign streams scheduling taking into account system scheduling. e.g. having so many queues to find streams w/ things to be done. Woudn't be better just to have only one sched. queue and then ask if scan/sched-svc-procs needs to be done? (lis_scantmout_handler): I would do just a lis_putnext for the held msg,... (i.e. process just the held msg). (Hmmm, must think) * You should check also head/TODO to find more things to be done. * head/stream.c (queuerun): It's prohibitive the time we've interrupts disabled here. We'll need to use Linux wait queue management stuff to dissable interrupts only to avoid dangling references. Mix in some flag to avoid running queuerun twice and voila! Tue Sep 5 09:26:14 1995 Francisco J. Ballesteros Camara <fcamara@rueda> * head/: It's compiled. It's still incomplete (some minor chunks needs to be written :- maybe just about a 1% or 5%). Mon Sep 4 12:12:30 1995 Francisco J. Ballesteros Camara <fcamara@rueda> * TODO: this will be the to-do list for the stream head, it'll contain puntual things to do, i.e. things that another volunteer should peek. Mon Jun 6 18:26:16 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/msg.c: FREE w/ two args?? (commented out the size (2nd) parm). The struct mdbblock must be defined. Would be a Good Thing to implemente que memory management. * include/sys/strconfig.h (LIS_STRDEV_RANGE): If this is defined as 0x0..010...0 wee could use & 0xf..f10...0 instead of '-'. * head/mod.h: Hmmmmm, where's initialized f_info?? * head/mod.c (lis_register_strdev): if the slot is busy we should just return no error. Actualy I'm not so sure the (un)register mod & str should be as they're now. Sun Jun 5 17:02:55 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/mod.h: fmodsw & fstrsw should be combined into the same * array (perhaps reserving a few slots for drivers and a few more for root). * Started makefile to compile LiS. a few modules compiled. Sat Jun 4 21:00:52 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * stream.h strmsg.h stropts.h strpoll.h sysmacros.h: change <linux/> by <sys/> * head/mdep.c: here'll be the kernel<->LiS entry points. Added lis_memfree() to notify LiS that kmem gets free'd Wed Jun 22 21:45:01 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/: to do things / improvements: bufcall: when kernel free is called & lis_strbcwait -> must set qrunflag (to process bufcalls/esbbcalls). Tue Jun 21 21:41:07 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * the stream head: code is complete but -- poll()'s not implemented --well, I've code out there but I guess it's better to include this as the last thing. It heavily depends on a linux kernel that changes fast. -- locks should be added/fixed. -- tty stuff should be added. -- code has not been compiled. -- code has not been tested. -- code has not been revised wrt SVr4 manuals,etc. -- some ioctls pending -- prty bands should be added/fixed -- prty msgs should be fixed in rd/wr getmsg/putmsg And the current ls is (problably head.[ch] is to be split...) TODO - the to-be-done list buffcall.[ch] - buffcall mgmt errmsg.[ch] - LiS errors & panics tools events.[ch] - streams events mgmt fifo.h - this is the fifo strtab flow.[ch] - flow handling -- Hmmm perhaps it could be merged head.[ch] - head main stuff syscalls actual implementation,... mod.[ch] - module & driver info mod.[ch] - module handling msg.[ch] - basic streams messages mgmt msgutl.[ch] - some additional utilities to manage streams messages poll.[ch] - scratch version for polling stuff [more code at home] queue.[ch] - streams queues mgmt safe.c - Graham's SAFE fns and adds on should be here share.h - shared stuff stats.[ch] - streams statistics go here stream.c - entry points to LiS, system calls, etc. test.c - Graham's testing main() wait.[ch] - wait queues & lock stuff Tue Jun 21 17:19:14 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/head.c (lis_strioctl): permanent links are implemented by incrementing the reference counter for the file struct on plinks and decrementing on punlinks. The RC scheeme is: -- plinks/punlinks inc/dec f->f_count for the muxing driver, so if the mux is closed the file entry will be kept alive. They will also inc/dec the stdata structs refcnts for both the muxing and muxed streams, so the heads are kept alive on close. -- stream open/close will inc/dec stdata structs (stream heads) sd_refcnt, when it's come to zero (no open descriptor and no permanent link held on) head will be deallocated. Mon Jun 20 18:11:16 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/head.c (lis_strdoioctl): It's inefficient. We should give it the msg as an argument to avoid innecessary copying. (str_alloc_mux): I guess it'd be better to alloc an arry for muxs. arry size could be preconfigured per device. Anyway have to change the sd_mux w/ a pointer to stmux_t and impose a limit in the number of muxed streams per mux. Sun Jun 19 20:51:55 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/head.c: There're some points where we could optimize. Many fields for the structs involved are used only in special cases. We could alloc & initialize them when needed. We could also do what Solaris does w/ structs initialization. Use a object cache to keep initialized objects pre-initialized when released. Mon Jun 13 17:23:40 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/head.c: Pending I_SETSIGs: S_OUTPUT,S_WRNORM,S_WRBAND: the write side events, this should be checked when the head wr queue gets backenabled.(?) S_MSG(?): we always issue this (M_SIG w/ sigpoll @ str head rd q) prty band must also be checked. I guess the code I've been writting has broken even norm band processing. :( I_FDINSERT: not implemented (copyin_str): currently it uses a new memory page. It should be implemented in a better way. Fri Jun 10 00:31:44 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/head.c (lis_str*): Should check str head err flags in each syscall. Mon Jun 6 21:56:06 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/head.c (lis_str...): In such funtions (but open) the inode is locked to avoid funny race conditions. When we first have a working version it'll be time to stretch locks. Not paid much attention to locking. It'd be good a combination of inode + wqueues locks * head/*.c: In functions w/ skeleton completed but ignoring issues such a flag mgmt (head/queue/... behaviour flags, etc.) and second-pass issues such as doing muxing, cloning,... the `STATUS' tag is set to `complete(?)' (note the question mark). You know for sure you have to revisit such functions when adding ioctls, code for nice features, etc. Sun Jun 5 21:18:55 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/stream.c (lis_stropen): Should we down/up(i->i_sem) ? Fri Jun 3 01:00:32 1994 Francisco J. Ballesteros <nemo@rigel.uc3m.es> * head/stream.c (lis_stropen): Another thing to check is that errnos are the same SVr4 returns. This needs just a few runs in a SVr4 machine. * head/stream.c: Will go on in a up-down fashion. Will follow file ops entry points and writing code until each of them is completed. By now I'll ignore is uninterruptable sleeps/awakenings are needed instead of interruptable ones. Will also ignore muxing and band issues. When the code is more or less working I'll go back to fix/add them. * head/stream.c (lis_stropen): probably would be better to use a semaphore in stdata than a wait_queue + lock char. Beware also that RD(),WR(),... macros do more check than needed in the stream head internal code, I mean that if we know a queue is a write queue then its rd queue is just q-1, not RD(q); and so on... Fri Jun 2 06:05:56 1995 Francisco J. Ballesteros <fcamara@pleyade> * include: Ok, I've done some work w/ the include stuff. My idea was to fix the user includes (U know, <sys/...> to use <sys/LiS/...> for internal stuff. Such internal stuff are the headers for internal files (see below). I've adopted the lis_ prefix for definitions in internal headers and redefine them in the external ones (to be a-la-SVR4). Anyway I've not checked user headers to be SVR4 compliant. (See the paragraph w/ label (1). * src: Created directory for the head stuff, exported includes are also moved to include/sys/ so we could use std <> delimiters for #include directive. * head: it has been splitted. Now we have some files: TODO - the to-be-done list buffcall.[ch] - buffcall mgmt events.[ch] - streams events mgmt msg.[ch] - basic streams messages mgmt msgutl.[ch] - some more utilities to manage streams messages queue.[ch] - streams queues mgmt stats.[ch] - streams statistics go here flow.[ch] - flow handling -- Hmmm perhaps it could be merged mod.[ch] - module handling stream.c - this is the main chunk (scheduling, etc.) test.c - Graham's testing main() I guess we could also create poll.[ch] to split internal poll code safe functions should also be moved to safe.[ch], but as their just for debug I'll leave them in stream.c by the moment. (1)-> We are now in position to split development in the head. One guy could go writing good headers (compliant w/ SVR4) other guy could add DDI/DKI headers for Linux and I could proceed filling up the internal head code (this last job can now also split ). * Also have added prefix lis_ to exported vars & functions to follow kernel hacker's guidelines. By now we could follow with the multi-file version. In a stabilized version we could just merge it away to avoid global namespace pollution, i.e. extern -> static conversion. Fri Mar 24 16:35 1995 Gram (gram@aztec.co.za) * removed infinite recursion in definitions of EXPORT:, etc * add strport.h, for system-dependent stuff. This should also be used to conditionally compile for kernel implementation or user-space testbed. Also, I don't favour basing this too much on a particular system like Solaris; I think we must aim for DDI/DKI conformance. That is all that matters. It should be possible to write most of the code independent of the particular kernel (stream heads may be an exception). Let's aim for that. Mon Feb 27 21:17:48 1995 Francisco J. Ballesteros (nemo@hades) * strmsg.h: Have to continue w/ API. continue at esballoc(). Mon Feb 13 20:22:07 1995 Francisco J. Ballesteros <nemo@hades> * modstreams/stropts.h: should assign STREAMS ioctls (FMNAMESZ): Should /import/ the max module name size. * modstreams/strmsg.h: I think every ioctl() should be transparent. (STIPRI/STOPRI): should define priorities to put the process to sleep and and awake it.... must think (STRHIGH/STRLOW): must adjust high/low wat. marks (MAXIOCBSZ): must adjust max ioctl block size. Sun Feb 12 20:42:40 1995 Francisco J. Ballesteros <nemo@hades> * modstreams/: kick off -> I'm just writing headers showing which fields of structs (etc) are for the usr and which are for the implementation of STREAMS framework. This should be considered the Linux STREAMS specification. Interface is a modified Solaris STREAMS stuff, i.e. Let's provide a Solaris-like STREAMS usr interface. * streams.c: STREAMS implementation. Hmmm probably we should split this. * strmsg.h: The STREAMS message stuff. Msg format, structs, symbols, etc. * stropts.h: The STREAMS operations stuff. ioctls, putmsg, etc. * poll.h: the poll()ing stuff. Event definitions, etc. Fri Feb 10 14:19:01 1995 Francisco J. Ballesteros Camara (fcamara@antares) * stream.h: the names used for both functions and data are kept as close as possible to the Solaris STREAMS stuff. This is to make easier the migration from SunOS/Solaris to Linux. must split it into modules: for kernel lvl, modules lvl, drivers lvl, statistics,etc.... Thu Feb 9 16:39:44 1995 Francisco J. Ballesteros Camara (fcamara@antares) * fs.h: changed struct inode to contain a pointer to the stream data (stdata) struct. As a stream inode will not have to know about sockets I decide to make a union and use the i_socket field storage for the new i_stdata entry. Such pointer will point to the appropriate linux module. * I start writing down some basic streams structures and modifying what I think it's more or less obvious [see ./linux.changes/... comments with "--nemo"]. * Modules: we have four system calls: sys_create_module(name,size) sys_init_module(name,code,codesize,modroutines) sys_delete_module(name) sys_get_kernel_syms(kernel_sym_table) I guess we could give a str_init() and str_close() to initilize and terminate the STREAMS framework. It's the service() procedures, and the remaining scheduling issues the ones that could retain us from making STREAMS a module. Anyway we could just modify the kernel itself as little as possible and keep the whole thing encapsulated in a module. Of course STREAMS modules could be also /modules/. :) I'll say "linux module" to refer to modules of /usr/src/linux/kernel/modules.c and "str module" to refer to STREAMS modules. (need not to be the same ;). ---------------------------------------------------------------------- # Local Variables: *** # mode:change-log *** # comment-column:60 *** # comment-start: "-" *** # comment-end: "-" *** # change-log-default-name: "NOTES" *** # End: ***