Commit Graph

204 Commits

Author SHA1 Message Date
Poul-Henning Kamp
87eafbcacd Moved the ft.c from 1.1.5.1 over. It works on my Conner thingie. Got
rid of a ton of unused vars at the same time.
1994-09-25 06:04:25 +00:00
Andrey A. Chernov
899fe378a6 1)Back out my previous change: only 8x16 font grabbing available,
more work required to grab all fonts
2)Make standard VGA font as default, make HARDFONTS an option
(load iso8859 fonts instead)
3)Check fonts_loaded for all restore (copy_font...palette)
sequences.
1994-09-25 02:06:51 +00:00
Andrey A. Chernov
248a9521f8 SAVE all fonts, if NO_HARDFONTS defined, not only 8x16 1994-09-24 21:29:38 +00:00
David Greenman
36317691a4 #if 0'd evil dynamic fifo trigger level adjustment; it just bit me and
a couple of other people again.
1994-09-21 19:39:25 +00:00
David Greenman
354c733261 From 1.1.5:
>date: 1994/05/27 01:09:16;  author: ache;  state: Exp;  lines: +3 -3
>Russian keymap: Ctrl-Alt-Del with NumLock on fixed
1994-09-21 18:43:08 +00:00
Bruce Evans
7fecb8e845 Don't lose the RTC interrupt in resettodr(). 1994-09-20 21:20:46 +00:00
Andrey A. Chernov
7b915aa631 resettodr() implemented, inittodr() fixed
Submitted by: me & chris@gnome.co.uk
1994-09-20 00:31:07 +00:00
Bruce Evans
eb51e37703 Remove some unnecessary #includes.
Restore the simple leap year calculation as a macro and document it so
that it doesn't become complicated again.  The simple version works
for all leap years covered by 32-bit time_t's.  The complicated version
doesn't work for all leap years covered by 64-bit time_t's since among
other reasons, the solar system is not stable for long enough.

Fix declarations.

Nuke spinwait().
1994-09-18 23:08:56 +00:00
Garrett Wollman
3f31c649d1 Redo Kernel NTP PLL support, kernel side.
This code is mostly taken from the 1.1 port (which was in turn taken from
Dave Mills's kern.tar.Z example).  A few significant differences:

1) ntp_gettime() is now a MIB variable rather than a system call.  A few
fiddles are done in libc to make it behave the same.

2) mono_time does not participate in the PLL adjustments.

3) A new interface has been defined (in <machine/clock.h>) for doing
possibly machine-dependent things around the time of the clock update.
This is used in Pentium kernels to disable interrupts, set `time', and
reset the CPU cycle counter as quickly as possible to avoid jitter in
microtime().  Measurements show an apparent resolution of a bit more than
8.14usec, which is reasonable given system-call overhead.
1994-09-18 20:40:01 +00:00
Joerg Wunsch
6b7bd95b6d Fixed the problem where the floppy has incorrectly failed probing
when the drive had been left on a cylinder > 67 after kernel boot. The
most common case for this is booting a kernel that is located on
the inner cylinders of a floppy.

Also removed all occurences of spinwait(), replaced by DELAY.
Nuked a return line saying nothing, this might make Bruce happy 8^)

Submitted by:	partially by Bruce Evans
1994-09-17 18:08:36 +00:00
David Greenman
3a2f7427fe Updated driver to the 1.1.5 version:
date: 1994/05/22 12:35:38;  author: joerg;  state: Exp;  lines: +6 -6
First round of floppy changes. Try making `fd' more robust.

New features:
  .  ioctl command for setting the drive type (density etc.); restricted
     to the super-user
  .  ioctl for getting/seting `drive options'; currently only option
     is FDOPT_NORETRY: inhibit the usual retries; used when verifying
     a newly formatted track

Fixes:
  .  function prototypes
  .  made all internal functions `static'
  .  cleaned up & corrected .h files
  .  restructured, to make the chaotic function sequence more rational
  .  compiled with -Wall, and cleared all warnings
  .  introduced a mirror for the (write-only) `digital output register',
     to avoid the current kludge
  .  device probing completed by seeking/recalibrating, and looking
     for track 0 being found
  .  holding the controller down in reset state while it is idle (and
     thus saving allot of headaches)
  .  make requests fail that are not a multiple of the (physical)
     sector size
  .  removed the fixed physical sector size (512 bytes), allowing for any
     size the controller could handle (128/256/512/1024 bytes)
  .  replaced some silly messages
  .  fixed the TRACE* macro usage, debugging reports should be complete
     now again (debugging output is HUGE! though)
  .  removed fd_timeout for SEEK command; seeks are always reported by
     the controller to succeed, since the `success' only refers to the
     controller's idea of success - there is no hardware line to tell about
     the seek end (other than the `track 0' line)
  .  catch SENSEI's that report about a `terminated due to READY changed'
     status - could happen after a controller reset
  .  converted ``hz / <something>'' divide operations to divisors that are
     powers of two, so gcc can optimize them into shifts
  .  write/format operations are checked against a write-protected medium
     now *prior* starting the operation
  .  error reports of `invalid command' and `wrong cylinder' will cause
     shortcuts in the retrier() now
  .  fixed a bug in the retrier() causing bogus block numbers to be reported
  .  fdformat() does care for errors now

Known Bugs:
  .  no attempts have been made (yet) to improve the performance
  .  sometimes, bogus ``seek/recalib failed'' messages are logged; this
     is still a bug in the driver, but it's not harmful since it's
     usually caught by the retrier()

Reviewed by:
Submitted by:
Obtained from:
1994-09-17 16:56:10 +00:00
Søren Schmidt
4f683116b4 Added support for many more videomodes, including graphic modes up til
320x200 256col VGA. This is nessesary for the iBCS stuff to work right.
(And we get the benefit of more video modes). Uses the videocard BIOS
to optain mode tables.
Added a "green" saver, switches off the syncs for "green" monitors.

Reviewed by:
Submitted by:
Obtained from:
1994-09-15 07:26:40 +00:00
Andrey A. Chernov
82a4cf2359 1. adjkerntz variable added for preparation to resettodr() implementation
2. Leap year calculations fixed
1994-09-14 23:09:06 +00:00
Poul-Henning Kamp
5b7ffe398f Digicom Systems Inc, makes "softmodems". What this means is simply that
you download the microcode to the DSP everytime you power on your system.
They provide a dos-program to do so, but no other support.  This commit adds
code to the sio-driver, which implement an ioctl, which will down-load the
micro-code.

To get this functionality, you must define DSI_SOFT_MODEM.

The program to actually employ the ioctl is not included, but the entire
source looks like this:

        #include <sys/ioctl.h>
        #include <stdio.h>

        main()
        {
                unsigned char buffer[100000];
                int i;

                read(0,buffer,100000);
                if((i = ioctl(1,TIOCDSIMICROCODE,buffer)) < 0)
                    perror("ioctl");
                return i;
        }

And you use it like this:
	smload < data144b.dsi > /dev/ttyid3

You need to copy the *.DSI files from the dos-media provide with your modem.
You can see what is downloaded by issuing the ATI3 command to the modem.
DSI's scheme for what code you can run on your modem isn't violated by this.

Poul-Henning Kamp
phk@freefall.cdrom.com
1994-09-13 03:30:31 +00:00
Andrey A. Chernov
b2be795bf2 Use RAW_PART=2 to trick diskerr 1994-08-29 21:32:31 +00:00
David Greenman
8a129caed5 1) Changed ddb into a option rather than a pseudo-device (use options DDB
in your kernel config now).
2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its
   own file.
3) Added \r handing in db_printf.
4) Added missing memory usage stats to statclock().
5) Added dummy function to pseudo_set so it will be emitted if there
   are no other pseudo declarations.
1994-08-27 16:14:39 +00:00
Bruce Evans
3e0a35fee4 Updated to final 1.1.5 version (revision 1.56).
Merged changes from 2.0 version (revisions 1.46-1.50) by hand.

Finished conversion to clists: removed flush of tty output buffer
in comflush() (most writes were truncated to 256 bytes) and restored
bypass of ttyinput() in siopoll().

Finished conversion to 2.0 types - more void *'s, less caddr_t's,
less casts, no Dev_t's.

Only these things are seriously broken now compared with 1.1.5:
waiting for output complete is impossible so ttywait() can deadlock;
sioclose() isn't called enough so sioopen() sometimes returns EBUSY
unnecessarily; input flow control is not implemented.
1994-08-25 10:15:28 +00:00
Paul Richards
d091793974 Ran ft.c through ident.
Added a missing #ifdef INET wrapper in lpt.c

Main change:
	Removed the timeout_func_t casts from timeout calls and
	correctly defined the timeout routines to conform to
	the new format.
lpt.c doesn't have this change.

Reviewed by:
Submitted by:
1994-08-23 07:52:29 +00:00
David Greenman
7b42c960f8 1) cleaned up after Garrett - fixed more redundant declarations, changed
use of timeout_t -> timeout_func_t in aha1542 and aha1742 drivers.
2) fix a bug in the portalfs that was uncovered by better prototyping -
   specifically, the time must be converted from timeval to timespec
   before storing in va_atime.
3) fixed/added some miscellaneous prototypes
1994-08-20 03:49:02 +00:00
Garrett Wollman
f23b4c91c4 Fix up some sloppy coding practices:
- Delete redundant declarations.
- Add -Wredundant-declarations to Makefile.i386 so they don't come back.
- Delete sloppy COMMON-style declarations of uninitialized data in
  header files.
- Add a few prototypes.
- Clean up warnings resulting from the above.

NB: ioconf.c will still generate a redundant-declaration warning, which
is unavoidable unless somebody volunteers to make `config' smarter.
1994-08-18 22:36:09 +00:00
David Greenman
8912c0ed61 Bruce Evans' dynamic interrupt support.
/usr/src/sys/i386/isa/clock.c:
	o Garrett's statclock changes.
	o Wire xxxintr, not Vclk.
	o Wire using register_intr(), not setidt().

/usr/src/sys/i386/isa/icu.s:
	o Garrett's statclock changes.
	o Removed unused variable high_imask.
	o Fake int 8 for rtc as well as int 0 for clk.  Required for kernel
	  profiling with statclock, harmless otherwise.

/usr/src/sys/i386/isa/isa.c:
	o Allow isdp->id_irq and other things in *isdp to be changed by
	  probes.  Changing interrupts later requires direct calls to
	  register_intr() and unregister_intr() and more care.
	  ALLOW_CONFLICT_* is brought over from 1.1.5, except
	  ALLOW_CONFLICT_IRQ is not supported.  IRQ conflict checking is
	  delayed until after probing so that drivers can change the IRQ
	  to a free one; real conflicts require more cooperation between
	  drivers to handle.
	o Too many details to list.
	o This file requires splitting and a lot more work.

/usr/src/sys/i386/isa/isa_device.h:
	o Declare more things more completely.

/usr/src/sys/i386/isa/sio.c:
	o Prepare to register interrupt handlers as fast.

/usr/src/sys/i386/isa/vector.s:
	o Generate entry code for 16 fast interrupt handlers and 16 normal
	  interrupt handlers.  Changed some constants to variables:
	  # $unit is now intr_unit[intr].  Type is int.  Someday it should
	    be a cookie suitable for the handler (e.g., a struct com_s for
	    sio).
	  # $handler is now intr_handler[intr].
	  # intrcnt_actv[id_num] is now *intr_countp[intr].  The indirection
	    is required to get a contiguous range of counters for vmstat
	    and so that the drivers depend more in the driver than on the
	    interrupt number (drivers could take turns using an interrupt
	    and the counts would remain correct).  There is a separate
	    counter for each device and for each stray interrupt.  In
	    1.1.5, stray interrupt 7 clobbers the count for device 7 or
	    something worse if there is no device 7 :-(.
	  # mask is now intr_mask[intr] (was already indirect).
	 o Entry points are now _XintrI and _XfastintrI (I = intr = 0-15),
	   not _VdevU (U = unit).
	 o Removed BUILD_VECTORS stuff.  There's a trace of it left for
	   the string table for vmstat but config now generates the
	   string in one piece because nothing more is required.
	 o Removed old handling of stray interrupts and older comments
	   about it.

Submitted by:	 Bruce Evans
1994-08-18 05:09:36 +00:00
Søren Schmidt
49e3cd80ee Oops, changed order of include lines...
Reviewed by:
Submitted by:
1994-08-17 19:32:23 +00:00
Søren Schmidt
529f6e548c Updated to latest 1.1.5.1+ version
Reviewed by:
Submitted by:
1994-08-17 08:51:59 +00:00
Garrett Wollman
0254742789 Add option KBD_RESET_FAIL_OK so that GCC 2.6 doesn't break my
console.
1994-08-15 22:41:33 +00:00
Garrett Wollman
8ea838500f Enable use of the RTC chip for the statistical clock. While this does
not provide the full accuracy of a randomized statistical clock, it does
provide greater accuracy than the previous method, while not significantly
increasing overhead.  It also provides profiling support at 1024 Hz.

You must re-compile config before making a new kernel, or you will end
up with unresolved symbols.

Reviewed uy:	Bruce evans said it worked for him.
1994-08-15 03:15:20 +00:00
Garrett Wollman
f540b1065a Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make
1994-08-13 03:50:34 +00:00
Garrett Wollman
fba73571bd For Pentium machines, use a faster version of microtime with 8 usec
resolution (can probably be improved somewhat).  Other machines take
a three-instruction hit if I586_CPU is defined, none otherwise.
1994-08-11 00:28:24 +00:00
Garrett Wollman
a4f90f4d45 Tell Pentium users their CPU speed. (More changes to make use of this
to come later.)
1994-08-10 23:28:33 +00:00
David Greenman
a445481c3e Fixed a bug that was introduced in the conversion from 1.1.5 to 2.0. 1994-08-01 10:38:19 +00:00
Rodney W. Grimes
35c2e6db96 Since we have removed com.c and renamed comreg.h to sioreg.h I need to
fix sio.c to #include sioreg.h.
1994-05-26 13:31:40 +00:00
Rodney W. Grimes
26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
Søren Schmidt
bc36c8064b Update the reprogram timer stuff, now the frequency of timer 0
can only be changed at the "right" times. Accuracy should be
assured.
1994-05-02 09:41:24 +00:00
Søren Schmidt
0573e73943 Updated swedish keymap. 1994-04-26 09:24:06 +00:00
Søren Schmidt
749613741c Fixed missing bounds check in scroll up/down sequence, that could
cause a panic (and did).
1994-04-26 09:09:57 +00:00
Garrett Wollman
9ad380ab4c Define new option, INACCURATE_MICROTIME_IS_OK. When this is defined,
the NTP kernel PLL is disabled, and acquire_timer0() is enabled, thus
opening the door for microtime() (and hence gettimeofday()) to return
bogus timestamps.  This option is necessary for the `pca' driver to
work, but is implemented to underscore the fact that accurate timekeeping
and the `pca' driver are incompatible at present.  If someone writes a version
of microtime() that works when the `pca' driver is being used, this can get
junked.
1994-04-23 21:39:18 +00:00
David Greenman
f66fdd6803 Added support for the 16 port Boca via a flag to specify that there is
no master port.
1994-04-23 02:11:43 +00:00
Søren Schmidt
872dacbfeb Changed timer usage to new functions in clock.c 1994-04-21 14:22:26 +00:00
Søren Schmidt
5194771d25 New support for sharing the timers
acquire_timer / release_timer

Pulled in timer related functions from isa.c
1994-04-21 14:19:16 +00:00
David Greenman
0e195446b7 Bug fixes and performance improvements from John Dyson and myself:
1) check va before clearing the page clean flag. Not doing so was
	causing the vnode pager error 5 messages when paging from
	NFS. (pmap.c)
2) put back interrupt protection in idle_loop. Bruce didn't think
	it was necessary, John insists that it is (and I agree). (swtch.s)
3) various improvements to the clustering code (vm_machdep.c). It's
	now enabled/used by default.
4) bad disk blocks are now handled properly when doing clustered IOs.
	(wd.c, vm_machdep.c)
5) bogus bad block handling fixed in wd.c.
6) algorithm improvements to the pageout/pagescan daemons. It's amazing
	how well 4MB machines work now.
1994-04-20 07:06:57 +00:00
Andrey A. Chernov
9642c2b7b8 Patch from S0ren, 80x50 font trashed after switching from X console 1994-04-12 00:05:23 +00:00
Andrey A. Chernov
758ba6e17a Fix arguments of CONS_GETINFO 1994-04-07 23:23:01 +00:00
Andrey A. Chernov
9cc0e7b511 Add declaration missing from previous bde's version 1994-04-03 12:25:57 +00:00
Andrey A. Chernov
fd59ff8180 CHANGES from Bruce:
---
This list of changes is in approximately chronological order (oldest first).

	o Many cosmetic changes - renamed comintr1 -> siointr1, moved
	  things around and fixed whitespace.
	o Reduced SLIP latency (FRAME_END hack) from 20-30 ms to 16 ms
	  at 115200 bps (you won't notice the average 10 ms improvement
	  on slow lines).  ppp seems to use only counted transfers so
	  there's no similar hack available.  It's too hard for the
	  driver to know the count.
	o Temporary #ifdefs for new and old interrupt handling
	  (OLD_INTERRUPT_HANDLING decided by setsofttty() not being
	  externally defined.
	o Don't test for the IIR_NOPEND bit being set - test for the
	  non-fifo part of the iir equalling it like the docs say to.
	  States with other IIR_NOPEND set in combination with the
	  other iir bits are undefined.  The docs may be stupid - the
	  old test would not have broken when the fifo bits were
	  introduced.
	o Noted more problems with DTR wait.
	o Rewrote console stuff.  Still some initialization and state
	  preservation problems.  Same for kgdb stuff.  The driver
	  doesn't do anything about the console close bug.  It needs
	  to be fixed entirely in i386/cons.c.  I like chmr's version
	  where the the console driver revectors the device open and
	  close routines.
	o Temporary (?) #ifdefs for references to tty buffers.
	o Noted further things to do in (2 comments about 3 places) for
	  phk's change to not touch RTS unless it is being used for flow
	  control.
	o Temporary #ifdefs for timestamp handling.  It needs fixing.
	  The microtime() call breaks the first rule of writing fast
	  interrupt handlers: NO calls to functions that might do slow
	  and bad things.  microtime() enables interrupts.  This turns
	  out to be only moderately harmful.  Also, I want the timestamp
	  copy outside of the normal interrupt handler.
	o Don't init com->tp early for the !DONT_MALLOC_TTYS case -
	  both sides are NULL.
	o Worry about com->tp == NULL in siopoll.  I don't see how you
	  survived the (incc <= 0 || !(tp->state & TS_ISOPEN)) test.
	  Perhaps early sttys or comcontrols set up the tp's for _all_
	  the ports before this code is reached.
1994-04-03 11:41:11 +00:00
David Greenman
d230622648 New interrupt code from Bruce Evans. In additional to Bruce's attached
list of changes, I've made the following additional changes:

1) i386/include/ipl.h renamed to spl.h as the name conflicts with the
   file of the same name in i386/isa/ipl.h.
2) changed all use of *mask (i.e. netmask, biomask, ttymask, etc) to
   *_imask (net_imask, etc).
3) changed vestige of splnet use in if_is to splimp.
4) got rid of "impmask" completely (Bruce had gotten rid of netmask),
   and are now using net_imask instead.
5) dozens of minor cruft to glue in Bruce's changes.

   These require changes I made to config(8) as well, and thus it must
be rebuilt.

-DG

from Bruce Evans:

sio:
	o No diff is supplied.  Remove the define of setsofttty().  I hope
	  that is enough.

*.s:
	o i386/isa/debug.h no longer exists.  The event counters became too
	  much trouble to maintain.  All function call entry and exception
	  entry counters can be recovered by using profiling kernel (the new
	  profiling supports all entry points; however, it is too slow to
	  leave enabled all the time; it also).  Only BDBTRAP() from debug.h
	  is now used.  That is moved to exception.s.  It might be worth
	  preserving SHOW_BITS() and calling it from _mcount() (if enabled).
	o T_ASTFLT is now only set just before calling trap().
	o All exception handlers set SWI_AST_MASK in cpl as soon as possible
	  after entry and arrange for _doreti to restore it atomically with
	  exiting.  It is not possible to set it atomically with entering
	  the kernel, so it must be checked against the user mode bits in
	  the trap frame before committing to using it.  There is no place
	  to store the old value of cpl for syscalls or traps, so there are
	  some complications restoring it.

Profiling stuff (mostly in *.s):
	o Changes to kern/subr_mcount.c, gcc and gprof are not supplied yet.
	o All interesting labels `foo' are renamed `_foo' and all
	  uninteresting labels `_bar' are renamed `bar'.  A small change
	  to gprof allows ignoring labels not starting with underscores.
	o MCOUNT_LABEL() is to provide names for counters for times spent
	  in exception handlers.
	o FAKE_MCOUNT() is a version of MCOUNT() suitable for exception
	  handlers.  Its arg is the pc where the exception occurred.  The
	  new mcount() pretends that this was a call from that pc to a
	  suitable MCOUNT_LABEL().
	o MEXITCOUNT is to turn off any timer started by MCOUNT().

/usr/src/sys/i386/i386/exception.s:
	o The non-BDB BPTTRAP() macros were doing a sti even when interrupts
	  were disabled when the trap occurred.  The sti (fixed) sti is
	  actually a no-op unless you have my changes to machdep.c that make
	  the debugger trap gates interrupt gates, but fixing that would
	  make the ifdefs messier.  ddb seems to be unharmed by both
	  interrupts always disabled and always enabled (I had the branch in
	  the fix back to front for some time :-().
	o There is no known pushal bug.
	o tf_err can be left as garbage for syscalls.

/usr/src/sys/i386/i386/locore.s:
	o Fix and update BDE_DEBUGGER support.
	o ENTRY(btext) before initialization was dangerous.
	o Warm boot shot was longer than intended.

/usr/src/sys/i386/i386/machdep.c:
	o DON'T APPLY ALL OF THIS DIFF.  It's what I'm using, but may require
	  other changes.
	  Use the following:
		o Remove aston() and setsoftclock().
	  Maybe use the following:
		o No netisr.h.
		o Spelling fix.
		o Delay to read the Rebooting message.
		o Fix for vm system unmapping a reduced area of memory
		  after bounds_check_with_label() reduces the size of
		  a physical i/o for a partition boundary.  A similar
		  fix is required in kern_physio.c.
		o Correct use of __CONCAT.  It never worked here for non-
		  ANSI cpp's.  Is it time to drop support for non-ANSI?
		o gdt_segs init.  0xffffffffUL is bogus because ssd_limit
		  is not 32 bits.  The replacement may have the same
		  value :-), but is more natural.
		o physmem was one page too low.  Confusing variable names.
	  Don't use the following:
		o Better numbers of buffers.  Each 8K page requires up to
		  16 buffer headers.  On my system, this results in 5576
		  buffers containing [up to] 2854912 bytes of memory.
		  The usual allocation of about 384 buffers only holds
		  192K of disk if you use it on an fs with a block size
		  of 512.
		o gdt changes for bdb.
		o *TGT -> *IDT changes for bdb.
		o #ifdefed changes for bdb.

/usr/src/sys/i386/i386/microtime.s:
	o Use the correct asm macros.  I think asm.h was copied from Mach
	  just for microtime and isn't used now.  It certainly doesn't
	  belong in <sys>.  Various macros are also duplicated in
	  sys/i386/boot.h and libc/i386/*.h.
	o Don't switch to and from the IRR; it is guaranteed to be selected
	  (default after ICU init and explicitly selected in isa.c too, and
	  never changed until the old microtime clobbered it).

/usr/src/sys/i386/i386/support.s:
	o Non-essential changes (none related to spls or profiling).
	o Removed slow loads of %gs again.  The LDT support may require
	  not relying on %gs, but loading it is not the way to fix it!
	  Some places (copyin ...) forgot to load it.  Loading it clobbers
	  the user %gs.  trap() still loads it after certain types of
	  faults so that fuword() etc can rely on it without loading it
	  explicitly.  Exception handlers don't restore it.  If we want
	  to preserve the user %gs, then the fastest method is to not
	  touch it except for context switches.  Comparing with
	  VM_MAXUSER_ADDRESS and branching takes only 2 or 4 cycles on
	  a 486, while loading %gs takes 9 cycles and using it takes
	  another.
	o Fixed a signed branch to unsigned.

/usr/src/sys/i386/i386/swtch.s:
	o Move spl0() outside of idle loop.
	o Remove cli/sti from idle loop.  sw1 does a cli, and in the
	  unlikely event of an interrupt occurring and whichqs becoming
	  zero, sw1 will just jump back to _idle.
	o There's no spl0() function in asm any more, so use splz().
	o swtch() doesn't need to be superaligned, at least with the
	  new mcounting.
	o Fixed a signed branch to unsigned.
	o Removed astoff().

/usr/src/sys/i386/i386/trap.c:
	o The decentralized extern decls were inconsistent, of course.
	o Fixed typo MATH_EMULTATE in comments. */
	o Removed unused variables.
	o Old netmask is now impmask; print it instead.  Perhaps we
	  should print some of the new masks.
	o BTW, trap() should not print anything for normal debugger
	  traps.

/usr/src/sys/i386/include/asmacros.h:
	o DON'T APPLY ALL OF THIS DIFF.  Just use some of the null macros
	  as necessary.

/usr/src/sys/i386/include/cpu.h:
	o CLKF_BASEPRI() changes since cpl == SWI_AST_MASK is now normal
	  while the kernel is running.
	o Don't use var++ to set boolean variables.  It fails after a mere
	  4G times :-) and is slower than storing a constant on [3-4]86s.

/usr/src/sys/i386/include/cpufunc.h:
	o DON'T APPLY ALL OF THIS DIFF.  You need mainly the include of
	  <machine/ipl.h>.  Unfortunately, <machine/ipl.h> is needed by
	  almost everything for the inlines.

/usr/src/sys/i386/include/ipl.h:
	o New file.  Defines spl inlines and SWI macros and declares most
	  variables related to hard and soft interrupt masks.

/usr/src/sys/i386/isa/icu.h:
	o Moved definitions to <machine/ipl.h>

/usr/src/sys/i386/isa/icu.s:
	o Software interrupts (SWIs) and delayed hardware interrupts (HWIs)
	  are now handled uniformally, and dispatching them from splx() is
	  more like dispatching them from _doreti.  The dispatcher is
	  essentially *(handler[ffs(ipending & ~cpl)]().
	o More care (not quite enough) is taken to avoid unbounded nesting
	  of interrupts.
	o The interface to softclock() is changed so that a trap frame is
	  not required.
	o Fast interrupt handlers are now handled more uniformally.
	  Configuration is still too early (new handlers would require
	  bits in <machine/ipl.h> and functions to vector.s).
	o splnnn() and splx() are no longer here; they are inline functions
	  (could be macros for other compilers).  splz() is the nontrivial
	  part of the old splx().

/usr/src/sys/i386/isa/ipl.h
	o New file.  Supposed to have only bus-dependent stuff.  Perhaps
	  the h/w masks should be declared here.

/usr/src/sys/i386/isa/isa.c:
	o DON'T APPLY ALL OF THIS DIFF.  You need only things involving
	  *mask and *MASK and comments about them.  netmask is now a pure
	  software mask.  It works like the softclock mask.

/usr/src/sys/i386/isa/vector.s:
	o Reorganize AUTO_EOI* macros.
	o Option FAST_INTR_HANDLER_USERS_ES for people who don't trust
	  fastintr handlers.
	o fastintr handlers need to metamorphose into ordinary interrupt
	  handlers if their SWI bit has become set.  Previously, sio had
	  unintended latency for handling output completions and input
	  of SLIP framing characters because this was not done.

/usr/src/sys/net/netisr.h:
	o The machine-dependent stuff is now imported from <machine/ipl.h>.

/usr/src/sys/sys/systm.h
	o DON'T APPLY ALL OF THIS DIFF.  You need mainly the different
	  splx() prototype.  The spl*() prototypes are duplicated as
	  inlines in <machine/ipl.h> but they need to be duplicated here
	  in case there are no inlines.  I sent systm.h and cpufunc.h
	  to Garrett.  We agree that spl0 should be replaced by splnone
	  and not the other way around like I've done.

/usr/src/sys/kern/kern_clock.c
	o splsoftclock() now lowers cpl so the direct call to softclock()
	  works as intended.
	o softclock() interface changed to avoid passing the whole frame
	  (some machines may need another change for profile_tick()).
	o profiling renamed _profiling to avoid ANSI namespace pollution.
	  (I had to improve the mcount() interface and may as well fix it.)
	  The GUPROF variant doesn't actually reference profiling here,
	  but the 'U' in GUPROF should mean to select the microtimer
	  mcount() and not change the interface.
1994-04-02 07:00:53 +00:00
Andrey A. Chernov
8ceb0f8dea Replace CAPS led with ALTGR led for ALTGR mode (soft) keyboards,
currently affects only russian keyboard.
1994-04-01 18:33:12 +00:00
Andrey A. Chernov
e330356ffb Change got_status/modem_status assignment per Bruce suggestion,
because inb clears modem status port.
1994-04-01 16:47:01 +00:00
Andrey A. Chernov
827f6dbf32 1) Better fix for false carrier detect on bidir port
2) ttyclose moved after comhardclose, because clears t_state
3) slpx(s) moved after l_open to prevent undetected carrier down
1994-03-26 13:40:18 +00:00
Andrey A. Chernov
70c0dd79d8 Fix false carrier detection on incoming bidir port. 1994-03-25 15:10:50 +00:00
Andrey A. Chernov
83bd7ca8b0 1) Change dtrwait 300 to 3 * hz (to be more kosher)
2) Protect sioclose by spltty()
1994-03-23 17:28:35 +00:00
Andrey A. Chernov
7116e6b71c Add siostop to sioclose, because ttyflush called from
wrong places removed now.
1994-03-21 22:19:56 +00:00
Andrey A. Chernov
67a850fc67 Increase default DTR wait time up to 3 secs.
Also hardw. specs says 2.5 secs is enough, many modems needs
at least 3 secs.
1994-03-21 15:18:27 +00:00
David Greenman
66ad8173f3 previous optimization from John wasn't quite ready for primetime. 1994-03-21 06:37:04 +00:00
David Greenman
93555dc983 Two fixes from John Dyson to fix hangs and panics when using ctrl-T:
1) tty.c: gather all the info about the processes before calling ttyprintf
	(which may block).
2) syscons.c: handle asynchronous output properly (data structures may
	be corrupted otherwise).
1994-03-20 20:05:55 +00:00
Andrey A. Chernov
65f120b86a Remove ttyfree from sioclose
Example:
Application use port cua01
Getty open ttyd1 (allocates rawq,outq,etc) and waits while application
done
Application quits, sioclose issued, ttyfree issued (getty calls revoke)
Getty awakes and goes to panic into initrb (NULL rawq)
1994-03-18 23:35:37 +00:00
Andrey A. Chernov
05e5086aab Checking l_close in unneeded (one of my previous fixes),
so back it out.
1994-03-14 18:52:14 +00:00
Andrey A. Chernov
2109bd5c86 Don't call ttyclose twice into sioclose and move ttyclose
before comhardclose
1994-03-10 10:06:27 +00:00
Andrey A. Chernov
3b2b53aa9a First open:
now HUPCL set only in bidir case for callin lines
(this prevents set HUPCL on mouse)
comhardclose:
in addition to HUPCL case now DTR dropped for bidir case
if line was active in and no carrier present now.
(this prevents DTR sleep on mouse)
1994-03-08 22:11:10 +00:00
Nate Williams
e7e0afea3b From: Jim Babb <babb@sedhps01.mdc.com>
Subject: Re: Bugs with floppy drives
Date: Tue, 8 Mar 94 9:11:54 CST

The transfer speed was only set in the retry after error, not  when
switching drives.
1994-03-08 16:25:29 +00:00
David Greenman
835b7809ab Modified pccnprobe to not set cn_tp = CONSOLE_TTY if __FreeBSD__ is
defined. This code should probably be yanked out.
1994-03-08 15:17:41 +00:00
Guido van Rooij
fe719280d0 Removed a #warning that I left here. 1994-03-06 20:56:26 +00:00
Guido van Rooij
79bdab6c87 Ttys structures are now allocated dynamically via ttymalloc/ttyfree.
This inetrface should be used from now on.
pseudo device pty xx still keeps its meaning: a maximum of
xx ptys is allowed.
A ringbuffer is now 2040 bytes long, per Garrett Wollman's request.
The changes are inspired by the way NetBSD did it (thanks for that!),
though I made it slihghtly different, including the interface so
at least 75% of the allocated space is deallocated when the tty is
closed.
Note further that it is easy to modify the ringbuffer length runtime.
This will have to wait untill some later date...


-Guido
1994-03-02 20:28:38 +00:00
Andrey A. Chernov
b0568305d3 360 DD entry speed fixed to 250KBPS 1994-03-02 18:34:41 +00:00
Andrew Moore
56ef028575 floppy tape support shouldn't interfere with floppy disk driver on
systems with no floppy tape drive (patch from Jim Babb).
1994-03-02 08:10:42 +00:00
Poul-Henning Kamp
bfbc1f09d4 RTS shouldn't be touched unless CS_RTS_IFLOW is set. 1994-02-26 00:04:03 +00:00
Poul-Henning Kamp
e3757377ff TIOCTIMESTAMP capability. The port in question must be configured with
"vector siointrts".  Thus only a compare is added for the other ports.
1994-02-24 16:39:48 +00:00
Nate Williams
a60eff2770 From: Jim Babb <babb@sedhps01.mdc.com>
Date: Mon, 14 Feb 94 15:57:14 CST

This adds a copyright to the fdc.h file and fixes a bug in re-tries
during writes on a heavily loaded system.
1994-02-14 22:24:28 +00:00
Andrew Moore
9c2638e6dc Tentative fdc patches... 1994-02-07 22:12:45 +00:00
Andrey A. Chernov
63ba5191a4 Change all siointr (expect in Vsio, of course) to comintr1
This saves two commands per each direct comintr1 call,
allows some strict check in siointr and also
fix bug with suspended output on multiport cards
1994-02-07 18:37:21 +00:00
Andrew Moore
b99f0a4a8d Add floppy tape driver - fd => fdc 1994-02-07 04:27:13 +00:00
David Greenman
ab377d1e00 From: Chris Wiener <cwiener@CRLABS.COM>
When the keyboard is probed, the LED's blink quickly and
"Keyboard reset failed" is printed on the console.  The
init routine keeps trying endlessly with the same behavior
as above.

I got the latest -current sup sources (06-Feb-94 12:00 GMT) to work using the
old syscons.c.  The following patch makes the new syscons work:
1994-02-07 02:14:27 +00:00
David Greenman
102cfb5c3e At the suggestion of Bruce Evans, don't zero RTC diag register. Doing so
was causing problems for some machines.
1994-02-06 22:48:13 +00:00
Andrey A. Chernov
4eab82a59a 1) Proper fix for suspended output in multiport case
2) IIR_NOPEND is really *one* bit, we don't need to check whole MASK
1994-02-06 11:59:35 +00:00
Christoph Robitschko
52fda4247e Make the screen savers runtime switchable. Everybody wants a
different default saver, and the size increase in the kernel is
minimal ( < 2.5K ).
1994-02-04 10:36:15 +00:00
Andrey A. Chernov
cd08e4cab2 Make BLANK_SAVER default to stop best saver war. 1994-02-02 23:10:55 +00:00
Andrey A. Chernov
04af1a4e41 Fix error in multiport part:
while input char not entered, output was suspended
1994-02-02 16:41:26 +00:00
Nate Williams
10a0cecedc Moved paren in sgetc to where it belongs. (My fault, I must have wiped it
out when I applied the patch to get the new features by hand)
1994-02-01 19:04:18 +00:00
Rich Murphey
20fabfa95d Add missing arg to Debugger() call.
Add missing close paren in sgetc() definition.
1994-02-01 15:09:10 +00:00
Andrey A. Chernov
7745b4472a Make old SNAKE_SAVER code compile with new syscons changes. 1994-02-01 11:13:49 +00:00
Andrey A. Chernov
cb2d71d5ea 1) Restore removed SNAKE_SAVER (Nate, WHY you do it?)
2) Make SNAKE_SAVER like default, if no saver specified in "options"
3) Remove #ifdef STAR_SAVER  before line /* make screensaver happy */
this code needed in any case.
1994-02-01 10:43:02 +00:00
Andrey A. Chernov
ebbb18695a Russian keymap is broken after last commit (fixed)
Nate, please, be more careful next time.
1994-02-01 09:27:43 +00:00
Andrey A. Chernov
12228508ab Comment #define STAR_SAVER, it is configuration "options" 1994-02-01 08:30:45 +00:00
Nate Williams
8b2e5491db From: sos@login.dkuug.dk (S|ren Schmidt)
Subject: syscons-1.3
Date: Sat, 29 Jan 94 23:33:50 MET

But here is the (hopefully) final syscons-1.3....

....

I've changed sgetc so it works as the pccons parallel
(it now uses a scgetc internally).


[
There were a couple changes that Bruce Evans sent me that were applied
to this version along with some changes that S'ren didn't incorporate
into the final version.  There will be only minor changes if anything
from this version to his final release.
]
1994-02-01 06:22:29 +00:00
Andrey A. Chernov
6405a87b09 Remove CALLOUTMASK, if non-bidir case. 1994-01-31 19:07:59 +00:00
Andrey A. Chernov
6df720041a 1) Set ipending back to 4, because (16 + 4) bit not in
netmask or impmask.

2) Fixes from Bruce:
	o Changed name of schedsoftcom() to setsofttty() to match
	  setsoftclock()
	o Bool_t isn't used.
	o tx_fifo_size is 1 for chips without fifos, 16 for 16550's, to
	  help to output more efficiently for 16550's (LSR_TXRDY means
	  that the fifo is empty, not that it has space for one char).
	o Changed name of softsio1() to siopoll() and merged compoll()
	  into siopoll().
	o The probe forgot to clear com_mcr after it failed.  This is
	  harmful for 4 single serial ports on 2 interrupts.  It makes
	  partial misconfigurations worse.
	o Don't bother initializing static variables that are 0 (bidir
	  stuff).
	o Only initialize t_oflag to TTYDEF_OFLAG if unit == COMCONSOLE,
	  not if COMCONSOLE is defined.
	o Don't call siointr() from comparam() if there is no output in
	  progress.  For the call from sioopen(), there's no output in
	  progress, and siointr() often saw silo overflows for stale
	  input because it was called before sioopen() discarded the
	  input.
	o Let ttselect() do the work for select(), so that the fixes for
	  ttselect() don't have to be duplicated in zillions of drivers.
1994-01-31 08:52:12 +00:00
David Greenman
d6eb591433 Patch from Brian Smith (modified a little by me) to allow kernel config
file override to disable fifo on 16550s:

I bought a board with two 16550's, but one of those ports has a mouse
on it.  The sio driver always enables the fifo, which is a bad thing
for mice and X.  The mouse is jerky and hard to use.  The simple thing
is be to treat one of the ports as a non-fifo'ed UART, and I use the
flags option in my config file.

So, my config file has:
device      sio0    at isa? port "IO_COM1" tty irq 4 flags 0x2 vector siointr
device      sio1    at isa? port "IO_COM2" tty irq 3 vector siointr

(patch deleted)
1994-01-31 06:12:18 +00:00
Andrey A. Chernov
2b1c7c76c3 Add Ctrl-Altr-Esc DBG key to RUKEYMAP (russian keymap) 1994-01-24 05:22:27 +00:00
Nate Williams
7af948c9cc Changed the default 'reboot' routine from cpu_reset() to shutdown_nice().
If you want to disable the reboot feature, then re-define the keymap to
not have a RBT call.
1994-01-18 05:33:34 +00:00
Nate Williams
87965552ef Changed the default syscons keymap to have <CTL-ALT-ESC> enter the
debugger and <CTL-ALT-DEL> call the reboot command.
1994-01-18 05:31:37 +00:00
David Greenman
7f8cb36869 "New" VM system from John Dyson & myself. For a run-down of the
major changes, see the log of any effected file in the sys/vm
directory (swap_pager.c for instance).
1994-01-14 16:25:31 +00:00
Andrey A. Chernov
e58072bda5 From ache:
Choose older MULTIPORT version, because lastest bde version
	not worked.
	Don't force HUPCL for bidirectional case.
From bde:
	Use bit (1 << (16 + 4)) in schedsoftcom() to avoid clash with
	non-serial h/w on IRQ4.
	Allow FIFO_TRIGGER in config.
	Clear com->mcr_image when clearing mcr for init of 4port.  The
	usual value MCR_IENABLE should have broken 4ports unless
	something happened to clear it later.
	Turn off interrupts as well as DTR after an error waiting for
	carrier (bidir dialin case).
	Drain fifo more carefully.
	Don't hang up if debugging.
	Rearrange siointr() -> siointr1() for multiport case for speed,
	lower latency and clarity.
	Use suser() to check perms.
	Provide missing splx() after failed perms checks.
	c_ispeed == 0 means c_ispeed = c_ospeed (POSIX).
	Set parameters (except speed) for c_ospeed == 0 as well as
	hanging up.
	Better initialization for console (fifo stuff...).
	Misc. cleanups.
	Fix dead hang if modem power is off.
1994-01-11 18:31:45 +00:00
David Greenman
c8a13ecd00 Convert syscall to trapframe. Based on work done by John Brezak. 1994-01-03 07:55:47 +00:00
Andrey A. Chernov
879d1ff90a Temporary plug CLOCAL security hole, while sticky bits
yet not implemented. Only for bidirectional case.
1994-01-02 10:17:29 +00:00
Andrey A. Chernov
126518a182 Use separate fields for format GAP and read/write GAP.
Restore usage of read/write GAP.
1993-12-21 05:09:21 +00:00
Rich Murphey
7f66f26d0c Don't cast 2nd arg to fillw() per David's comments. The cast
breaks cursor positioning.
1993-12-21 03:27:26 +00:00
Rich Murphey
81664caf74 cast arg 2 of fillw() calls to type caddr_t as in pccons.
add "manual escape to debugger" arg in call to Debugger().
cast 1st arg to untimeout() to type timeout_func_t as done for timeout().
1993-12-21 02:49:13 +00:00
Garrett Wollman
aaf08d94ca Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit.  Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.

NB: -Wtraditional will henceforth be forgotten.  This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax.  These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.
1993-12-19 00:55:01 +00:00
Andrey A. Chernov
b39c878e2b Media table reorganization.
Entries for 800 and 820 fixed.
From vak@kiae.su:
incorporate Joerg Wunsch formatting code
correct handle timeouted operations
fixed entry for 720 media
1993-12-19 00:40:49 +00:00
Andrey A. Chernov
f4d3408967 Fix tsleep "waitvt" wait data from vak@kiae.su 1993-12-18 22:50:51 +00:00
Andrey A. Chernov
ed2fa05ece Reorganization of format table.
GAP values changed suitable for possible format code addition.
Read/write GAP always 2 now.
Interleave parameter added for possible format code addition.
Many logical formats added.
720K physical drive added.
Problems: still can't read 720..820 media in 1.44 drive.
1993-12-18 01:16:26 +00:00
Andrey A. Chernov
159569a418 RTCFDT_720K (physical drive 720K) added. 1993-12-18 01:12:47 +00:00