[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
misc questions/comments... and a patch (MiNT 1.09)
i have a few things now...
1. what is the best way for a DEV_INSTALLd device to read a pipe to
get data from a daemon process? currently i have device_open call
f_open ("u:\\pipe\\...", O_RDONLY|O_GLOBAL) thru dos_tab and then later
f_read, f_cntl etc. that works but if i could somehow use FILEPTRs
directly it would save at least global handles.
2. it would be nice if a device could set its modification time...
i can pass device_datime thru to the pipe but ls -l /dev (i.e. stat())
doesn't seem to use that, it still prints the current time. for you
to decide if the kernel should be changed or stat on /dev should call
Fdatime... (with ls -l /pipe it works btw.) and btw it would also be
nice if chmod/chown worked on devices, be it only to implement mesg n. :)
4. MiNTs debug output can sometimes make it very difficult to get
keyboard input thru to processes on the console... it gobbles up
characters like no good. here'a a patch that makes it eat chars only
while ctrl+alt are down, i.e. to start/stop debug output on the console
you now use ctrl-alt-<anykey>, not just any key.
--- debug.c_ Wed Sep 1 13:24:16 1993
+++ debug.c Tue Sep 14 22:42:02 1993
@@ -264,15 +264,18 @@
stopped = 0;
while (1) {
/* got a key; if ctl-alt then do it */
- key = Bconin(out_device);
if (out_device == 2) {
if ((Kbshift(-1) & 0x0c) == 0x0c) {
+ key = Bconin(out_device);
scan = (int) (((key >> 16) & 0xff));
- do_func_key(scan);
+ if (!(char)key || ' ' < (unsigned char)key)
+ do_func_key(scan);
+ else goto ptoggle;
}
- else goto ptoggle;
+ else goto cont;
}
else {
+ key = Bconin(out_device);
if (key < '0' || key > '9') {
ptoggle: /* not a func key */
if (stopped) break;
@@ -287,6 +290,7 @@
}
}
}
+cont:
s++;
}
}
5. to use tfork for things vfork was originally introduced for ;) (i.e.
nonblocking fork that shares parents address space) you currently have
to reset close-on-exec flags and signals for the child... seems the
kernel treats tfork more like an exec than like a fork. if this would
be changed (maybe needs a new Pexec mode?) the library could probably
easily implement a `real' vfork... (ok malloc etc still are not
re-entrant(sp?) but thats another story.)
6. is there something like a gem.prg (== start GEM) i can use with init
that shuts down GEM gracefully when it gets SIGHUP? the one i have
seems to be from pre-MiNT days and doesn't know about signals.
(well i don't know if its even possible to shut down GEM gracefully...
maybe save all vectors GEM changes and restore them on signals?)
7. terminal (or should i say pocket calculator :) if you know hp48...)
on a serial port, stty -tandem: ^S (stopc) stops output but ^Q doesn't
continue... i.e. seems nothing in the kernel looks for startc on serial
ports! :-) (workaround: use stty tandem... but that doesn't help when
the terminal/modem/whatever needs hardware handshake.)
8. when a pipe (pty) writer exited Finstat (or ioctl FIONREAD etc)
returns -1 immediately even when there still is data left in the pipe.
is that correct(tm) behavior?
9. and while we're at it... can someone who has BSD sources online
(or whatever) look what happens to a ttys process group when a pgrp
leader exits? i forgot to say that last time but just leaving it
caused me problems with init, thats why i had to put the ioctl TIOCSPGRP
there...
ok and if you read up to here... the reason for the first 6 points
comes with the next message. :-)
cheers
Juergen
--
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
...ohne Gewehr
PGP public key fingerprint = 8A 18 58 54 03 7B FC 12 1F 8B 63 C7 19 27 CF DA