Commit Graph

16535 Commits

Author SHA1 Message Date
Nick Hibma
51b98897fa Only NetBSD needs sys/device.h. 1999-08-29 11:56:49 +00:00
Nick Hibma
a7fa9611ed Only NetBSD uses sys/device.h
Error-reported-by:	phk
1999-08-29 11:49:22 +00:00
Marcel Moolenaar
e459b442df Fix a braino: Linux minor device numbers are 8 bits wide and not 10. 1999-08-29 11:47:01 +00:00
Bruce Evans
1961e4302a Fixed printf format errors (don't assume that ntohl() returns u_long;
it returns u_int on i386's and in_addr_t (u_int32_t) on alphas).
1999-08-29 10:28:10 +00:00
Bruce Evans
684f9417a2 Oops, I missed a cast in rev.1.119. 1999-08-29 10:23:13 +00:00
Bruce Evans
09c1244640 Removed dysfunctional/defunct options KERNFS_DIAGNOSTIC,
UMAPFS_DIAGNOSTIC and UNION_DIAGNOSTIC.  Uncommented NULLFS_DIAGNOSTIC.
It is as bogus as the above three but since it is already a new-style
option it is easier to use it than to fix it.
1999-08-29 10:14:59 +00:00
Bruce Evans
8021ba879a Changed old-style option UNION_DIAGNOSTIC to DEBUG and fixed printf
format errors exposed by this.  It has nothing to do with diagnostics
since it does little more than control tracing of normal operation.
Actual diagnostics for the union file system are still controlled by
the DIAGNOSTIC option.
1999-08-29 10:03:35 +00:00
Bruce Evans
b00b6d73dd Changed old-style options UMAPFS_DIAGNOSTIC and UMAP_DIAGNOSTIC to DEBUG
or DDB and fixed printf format errors exposed by this.  The options had
little to do with diagnostics; they mostly controlled tracing of normal
operation.
1999-08-29 09:54:17 +00:00
Bruce Evans
47966f4c8a Changed old-style option KERNFS_DIAGNOSTIC to DEBUG and fixed printf
format errors exposed by this.  It has nothing to do with diagnostics
since it does little more than control tracing of normal operation.
1999-08-29 09:38:25 +00:00
Poul-Henning Kamp
f054c29093 Merge alpha and pc98 changes into i386 MBR handling code and replace all
three copies with one copy in MI land.
1999-08-29 09:12:54 +00:00
Poul-Henning Kamp
83d34e0b60 initialize si_bsize_phys from what the drive told us. 1999-08-29 09:10:05 +00:00
Poul-Henning Kamp
d137accc89 Add dev_t freeing code. Controlled by sysctl debug.free_devt, default
is off.
1999-08-29 09:09:12 +00:00
Bruce Evans
3de9d6fbe4 Don't restrict our requests for contiguous memory to addresses >= 1MB.
This fixes, at least, panics in ncr_attach() on i386's with about 5MB
of memory.  The restriction was a hack to leave some low memory for ISA
DMA, but on i386's we now allocate pages from the top down, so all the
restriction did was cause our allocations to fail when there is no free
memory above 1MB.
1999-08-29 09:03:58 +00:00
Marcel Moolenaar
d4c45842d7 Fix a missing '-1' in the size argument of copyout in getgroups. Spotted while
reviewing the MFC in -stable.
1999-08-29 08:52:38 +00:00
Poul-Henning Kamp
0bd2b984ce Sort the easy part of this file. It should be all sorted. 1999-08-29 08:44:18 +00:00
KATO Takenori
a8c345fb03 Changed from dname into devtoname(bp->b_dev) in the function dsinit(). 1999-08-29 05:05:27 +00:00
Masahide MAEKAWA
52b18414f4 o fix typo 1999-08-29 02:05:12 +00:00
Greg Lehey
03705cdeb7 Initialize the si_bsize fields of the new dev structure. This fixes
some swapper problems analogous to those experienced with ccd.

This fix is a kludge: since we currently don't track the "sector size"
in a volume label, we guess a worst case (4 kB, as used by vnode
devices).  If the concept of sector size is here to stay, I'll make
some changes to track the "sector size" of a volume.  This will
probably be the maximum of the sector sizes of all component drives,
but things could get ugly if we start allowing non-standard sector
sizes such as 524 bytes.

Unkludged-version-submitted-by:	phk
1999-08-29 01:41:53 +00:00
Masahide MAEKAWA
a0f9149b19 o synchronisation with NetBSD
Reviewed by:	Hick Hibma
Obtained from:	NetBSD
1999-08-29 01:18:32 +00:00
Nick Hibma
ca66889cf7 Correct URL's and change ifdef to if defined (following rest of style in
file)
1999-08-28 20:10:46 +00:00
Nick Hibma
805bb37eb5 Remove NetBSD specific code. USB part is trivial, and the rest is not
shared anyway.
1999-08-28 20:09:34 +00:00
Poul-Henning Kamp
94db13fe98 Fix various trivial warnings from LINT 1999-08-28 19:44:07 +00:00
Poul-Henning Kamp
a87b535090 Put a brief comment on a couple of #defines. 1999-08-28 19:21:36 +00:00
Poul-Henning Kamp
9626728875 remove unused variables. 1999-08-28 19:21:03 +00:00
Poul-Henning Kamp
a978dc23b7 #include <sys/queue.h> 1999-08-28 19:20:07 +00:00
John Hay
01d3efc077 Get rid of the old XNS checksum code and implement it the IPX way.
PR:		13374
Submitted by:	Boris Popov <bp@butya.kz>
1999-08-28 18:21:55 +00:00
Yoshihiro Takahashi
3dec6735e5 Merge missing changes from sys/i386/conf/GENERIC. 1999-08-28 16:49:58 +00:00
Yoshihiro Takahashi
cbf0618984 Fix ordering. 1999-08-28 16:20:53 +00:00
Yoshihiro Takahashi
c8662eda6f - The old printer driver is renamed 'olpt'.
- Added the gdc driver.
1999-08-28 15:17:25 +00:00
KATO Takenori
c41e88e949 Added MII bus support.
Reminded by:	phk
1999-08-28 15:04:27 +00:00
Larry Lile
fcf11853dc It is much easier to arp if you don't truncate your arp-reply's.
[affects token-ring only]
1999-08-28 14:57:12 +00:00
Poul-Henning Kamp
10af1a2b5f We don't need to pass the diskname argument all over the diskslice/label
code, we can find the name from any convenient dev_t
1999-08-28 14:33:44 +00:00
Hellmuth Michaelis
f5fe620a92 add MAINTAINER for the kernel part of i4b 1999-08-28 13:35:00 +00:00
Nick Hibma
d447ab3427 Thou shall do a make before commit.
[grmbl]
Fix duplicate elements in struct in previous commit.
1999-08-28 11:52:12 +00:00
Nick Hibma
d88879933b We use device_set_desc_copy, so we do not need to free the copied text
manually.
1999-08-28 11:35:36 +00:00
Nick Hibma
f748f71688 Share more between FreeBSD and NetBSD 1999-08-28 11:31:21 +00:00
Nick Hibma
7e8893c9b4 Update the list of devices from NetBSD 1999-08-28 09:39:54 +00:00
Marcel Moolenaar
9e8b10d186 Add MAINTAINER and remove the unused COMPAT_LINUX and VM_STACK defines. 1999-08-28 09:04:21 +00:00
Marcel Moolenaar
86f95e6b6d Implement the OSS_GETVERSION ioctl. The version returned can be changed through
the sysctl variable `compat.linux.oss_version'.

PR: 12917
Originator: Dean Lombardo <dlombardo@excite.com>
1999-08-28 08:43:03 +00:00
Poul-Henning Kamp
9465bf4495 Initialize dev->si_bsize*, the floppy driver doesn't use dsopen(). 1999-08-28 08:10:13 +00:00
Brian Feldman
78f9020e95 Also make the "other" packets counter resettable. 1999-08-28 07:20:59 +00:00
Brian Feldman
bbeaed0909 Back out the cdevsw_remove() from previous revision for further testing. 1999-08-28 07:06:11 +00:00
Brian Feldman
b519d997a1 Unevilize vn(4) somewhat:
1. implement read-only ability
	2. make it play nice with cdevsw (use cdevsw_remove() uon kldunload)
1999-08-28 06:21:39 +00:00
Peter Wemm
2185977908 Regen after Id->FreeBSD 1999-08-28 02:35:56 +00:00
Peter Wemm
ee15718941 $Id$ -> $FreeBSD$ (some mangled and/or hidden ones) 1999-08-28 02:21:15 +00:00
Peter Wemm
280652828b $Id$ -> $FreeBSD$ 1999-08-28 02:16:32 +00:00
Peter Wemm
dacec3e8f2 Id -> FreeBSD 1999-08-28 01:15:37 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Brian Feldman
4d1bb12d6c Correction: uid -> gid (comment) 1999-08-27 23:46:02 +00:00
Peter Wemm
a4add9a9b1 $Id$ -> $FreeBSD$ 1999-08-27 23:45:13 +00:00
Bill Paul
b3bc7a4bb0 Fix path for miibus_if.m (mii > dev/mii); 1999-08-27 21:21:53 +00:00
Bill Paul
05d6200e3f Make some cleanups related to miibus. 1999-08-27 21:18:02 +00:00
Marcel Moolenaar
c6dfea0ebd Add sysctl variables for the Linuxulator. These reside under `compat.linux' as
discussed on current.

The following variables are defined (for now):

    osname (defaults to "Linux")
        Allow users to change the name of the OS as returned by uname(2),
        specially added for all those Linux Netscape users and statistics
        maniacs :-) We now have what we all wanted!

    osrelease (defaults to "2.2.5")
        Allow users to change the version of the OS as returned by uname(2).
        Since -current supports glibc2.1 now, change the default to 2.2.5
        (was 2.0.36).

    oss_version (defaults to 198144 [0x030600])
        This one will be used by the OSS_GETVERSION ioctl (PR 12917) which I
        can commit now that we have the MIB. The default version number is the
        lowest version possible with the current 'encoding'.

A note about imprisoned processes (see jail(2)):
  These variables are copy-on-write (as suggested by phk). This means that
  imprisoned processes will use the system wide value unless it is written/set
  by the process. From that moment on, a copy local to the prison will be
  used.

A note about the implementation:
  I choose to add a single pointer to struct prison, because I didn't like the
  idea of changing struct prison every time I come up with a new variable. As
  a side effect, the extra storage is only needed when a variable is set from
  within the prison. This also minimizes kernel bloat when the Linuxulator is
  not used; both compiled in or as a module.

Reviewed by: bde (first version only) and phk
1999-08-27 19:47:41 +00:00
Bill Paul
d0dca9afa4 Update these Makefiles; add mlphy and tlphy to the mii module, add
miibus_if.h to tl module's dependencies.
1999-08-27 19:45:19 +00:00
Jonathan Lemon
7e42e2f811 Reference the correct gdt[] entry on SMP. Remove the `generation' flag,
and always reload the selectors for every bios call.
1999-08-27 19:39:20 +00:00
Bill Paul
46c8f7f1c2 Convert the ThunderLAN driver to miibus. This took me a while because I
had to get the ML 6692 PHY driver working correctly, which is harder than
it sounds. "Bitrate" ThunderLAN devices should still be supported (i.e
the older 10Mbps Netflex 3/P, which use the TNETE110 chip that has no
MII support). The ThunderLAN has an internal PHY which makes things a
little complicated, but these are the basic rules:

- For devices with just the ThunderLAN, the internal PHY is used to
  provide 10baseT, and 10base5/10baseT support. Autonegotiation will
  work, but only with 10baseT links. The only thing that really gets
  negotiated is whether the link is full or half duplex.

- For devices with the ThunderLAN and an external 10/100 PHY (like the
  Compaq Netelligent 100Mbps cards, or the internal Netflex 3/P with
  100Mbps upgrade daughter card), the external PHY is used for 10baseT
  and 100baseTX modes. The internal PHY is still used to support
  10base5/10base2, though you have to select them manual with ifconfig.

- For devices with the ThunderLAN and the ML6692 PHY, both the internal
  and external PHYs are used, though it will appear as though the 6692
  PHY will be used to support 10baseT and 100baseTX modes. In reality,
  the internal PHY will be used for 10baseT, but this fact will be hidden
  from the user. The 10base5/10base2 modes can also be selected manually
  as with above.
1999-08-27 18:58:27 +00:00
Bill Paul
d341237291 Add miibus drivers for the ThunderLAN internal PHY and the Micro Linear
ML6692 PHY. The Micro Linear driver is my own; the ThunderLAN driver is
a port of the NetBSD driver with various hacks. The ML driver is necessary
to support the Olicom OC-2326 ThunderLAN-based NIC.

Also regenerated miidevs.h to pick up the proper 'obtained from'
revision string.
1999-08-27 18:33:36 +00:00
Brian Feldman
b5fca1cb2a Add FIODTYPE ioctl for getting d_flags (type) info on a device.
Okayed by:	phk
1999-08-27 16:35:37 +00:00
Andrew Gallatin
34067f9475 Fix the child's return path from fork so that fork will return 0
in the child.  This corrects a problem where linux/alpha binaries see
the child's return value of fork as the parent's pid.  This happens because
linux/alpha binaries apparently check the return value directly, rather
than looking for a non-zero value in a4, as *BSD & OSF/1 do.

Reviewed by:dfr@nlsystems.com
1999-08-27 14:47:23 +00:00
Kazutaka YOKOTA
21f652c5b1 - Retain the previous vty and history buffers when setting up
the graphics mode.  This was the behavior prior to syscons.c
  rev 1.278, but broken in scvidctl.c rev 1.1.
1999-08-27 09:20:41 +00:00
Kazutaka YOKOTA
484fc65c06 - Set the correct value to va_line_width while in the ioctl
FBIO_SETLINEWIDTH.
1999-08-27 09:19:50 +00:00
Kazutaka YOKOTA
23ed6fc8bc - Ouch! Do not assume the VESA BIOS will preserve the upper 16 bits
of EAX and EBX.
1999-08-27 09:18:42 +00:00
Peter Wemm
08bf4f641e A few style changes (fixes hopefully) and some more tidying up. Fix (?)
the volatile cast warnings.
1999-08-27 08:32:54 +00:00
Julian Elischer
501f7f80bd Remove some vestiges of devfs direct calls. 1999-08-27 08:31:20 +00:00
Julian Elischer
ada9bd8cb8 Add PHK's make_dev() into more places where DEVFS used to be
hooked in directly.

Alpha change checked by: Matthew Jacob <mjacob@feral.com>
i4b ISDN changes checked by: Udo Schweigert <ust@cert.siemens.de>
    and Hellmuth Michaelis <hm@hcs.de>
PC98 changes checked by: Takahashi Yoshihiro <nyan@FreeBSD.org>
1999-08-27 07:26:26 +00:00
Peter Wemm
4e895e3962 Don't return 0 for an unknown ioctl (!). This was breaking ppp(8).
Slight tidy up while here.
1999-08-27 06:53:34 +00:00
Jonathan Lemon
6da3d6578b Add readonly OID ``net.inet.tcp.tcbhashsize'' so it is possible to
discover the size of the TCB hashtable on a running system.
1999-08-26 19:52:17 +00:00
Dima Ruban
d44e415624 Don't follow symlinks on coredumps.
Reviewed by:	dillon && security-officer
1999-08-26 17:32:48 +00:00
Poul-Henning Kamp
dbafb3660f Simplify the handling of VCHR and VBLK vnodes using the new dev_t:
Make the alias list a SLIST.

        Drop the "fast recycling" optimization of vnodes (including
        the returning of a prexisting but stale vnode from checkalias).
        It doesn't buy us anything now that we don't hardlimit
        vnodes anymore.

        Rename checkalias2() and checkalias() to addalias() and
        addaliasu() - which takes dev_t and udev_t arg respectively.

        Make the revoke syscalls use vcount() instead of VALIASED.

        Remove VALIASED flag, we don't need it now and it is faster
        to traverse the much shorter lists than to maintain the
        flag.

        vfs_mountedon() can check the dev_t directly, all the vnodes
        point to the same one.

Print the devicename in specfs/vprint().

Remove a couple of stale LFS vnode flags.

Remove unimplemented/unused LK_DRAINED;
1999-08-26 14:53:31 +00:00
Poul-Henning Kamp
9c93810d2d Initialize the dev->si_bsize fields.
Submitted by:	tegge
Reviewed by:	phk
1999-08-26 14:46:10 +00:00
Doug Rabson
50de873b59 Fix DMA macros to work on alpha. 1999-08-26 08:41:41 +00:00
Doug Rabson
22147525d2 Don't schedule the next transaction if the pipe is being aborted. 1999-08-26 08:40:55 +00:00
Bill Paul
cbc20d30a5 Properly re-enable the transmitter in the TX error handler. 1999-08-26 05:31:53 +00:00
Bill Paul
2f0f7ef0a6 Handle buses with multiple PHYs correctly. 1999-08-26 05:30:33 +00:00
Greg Lehey
2de219e97f Change asf function to use the new name of the list in kern_linker.c.
See revision 1.35 of sys/kern/kern_linker.c.
1999-08-26 04:01:37 +00:00
Greg Lehey
4e72079195 read_drive: Remove references to vp->v_lastr, which is going away.
Reviewed-by:	dillon
1999-08-26 03:27:21 +00:00
Greg Lehey
35b5051ab9 complete_rqe: explicitly reinitialize b.b_iodone. This shouldn't have
changed, but we've seen some weird cases of b_iodone
	      being NULL, and they don't make any sense.

Suffered-by:  Bernd Walter <ticso@cicely.de>
1999-08-26 03:26:39 +00:00
Greg Lehey
ca55837990 config_plex: don't allocate a rangelock struct.
lockrange: correctly expand rangelock struct, including expanding a
	   null struct.  Previously lockrange would attempt to lock a
	   NULL pointer under these circumstances.

Reported-by:	Ian Freislich <iang@uunet.co.za>
1999-08-26 03:25:38 +00:00
Peter Wemm
399f34180a Use .p2align to ensure consistant a.out/elf alignment. I'd have used
SUPERALIGN_TEXT, but this is inline assembler and after cpp has run.
Inspired by bde's comments on linux_locore.s.
1999-08-25 23:50:03 +00:00
Peter Wemm
4a54450a9d It would help if things that MUST be 32 bit aligned were really 32 bit
aligned.  If I recall correctly, this is to ensure apic_imen can be
accessed in a single bus cycle.  Also, use TEXT_ALIGN rather than a
.align 2 (which means 2 byte align on ELF and 4 byte align on a.out)
1999-08-25 23:42:02 +00:00
Mark Newton
776a8f98ee Replace ".align 2" with "ALIGN_TEXT" as per recent discussion re: the linux
emulator.

Suggested by:	bde
1999-08-25 22:55:56 +00:00
Julian Elischer
2a1be8333d Make a place to store the devfs hook for the block device, as the same
specinfo is used to identify both raw and block version sof a device.
1999-08-25 22:50:12 +00:00
Marcel Moolenaar
ae4ea3eed4 Use ALIGN_TEXT macro for alignment to avoid ambiguity.
Pointed out by: bde
1999-08-25 19:04:39 +00:00
Matt Jacob
2d712f3d8d what is a devuce? 1999-08-25 18:05:52 +00:00
Marcel Moolenaar
4e0eaf6924 Fix linux_newlstat in that it doesn't return the attributes of its containing
directory. Also, update arguments of NDINIT for both newstat and newlstat.

While I'm at it, fix style bugs in all {s|ls|fs}tat syscalls.

Reported by: bde
1999-08-25 15:23:54 +00:00
Marcel Moolenaar
c85f67175f Fix {g|s}etgroups semantics. We use cr_groups[0] to hold egid. This means that
egid will be twice in the set and that setting cr_groups[0] will change egid.
This is simply solved by ignoring cr_groups[0]. That is; linux_getgroups does
not return cr_groups[0] and linux_setgroups does not touch it.

Noticed by: bde
Brought to my attention by: sheldonh
1999-08-25 14:11:01 +00:00
Marcel Moolenaar
296f7267f3 Fix lingo: 'is not implemented or obsoleted' is not the same as 'is obsoleted
or not implemented'.
1999-08-25 13:17:05 +00:00
Poul-Henning Kamp
41d2e3e09e Introduce vn_isdisk(struct vnode *vp) function, and use it to test for diskness. 1999-08-25 12:24:39 +00:00
Poul-Henning Kamp
a431597b25 Add a couple of missing but unimportant break; statements. 1999-08-25 11:44:11 +00:00
Marcel Moolenaar
2fdc82e093 Change all UNIMPL syscalls to STD and add them to linux_dummy. Now we always
know if and when an unimplemented or obsoleted syscall is being used. Make the
message more end-user friendly.

And as long as we're here, rename some unimplemeted syscalls (linux_phys ->
linux_umount2, linux_vm86 -> linux_vm86old, linux_new_vm86 -> linux_vm86).

Change prototype for linux_newuname from `struct linux_newuname_t *' into
`struct linux_new_utsname *'. This change is reflected in linux.h and
linux_misc.c.
1999-08-25 11:19:03 +00:00
Marcel Moolenaar
fc4529a0d1 Change all UNIMPL syscalls to STD and add them to linux_dummy. Now we always
know if and when an unimplemented or obsoleted syscall is being used. Make the
message more end-user friendly.

And as long as we're here, rename some unimplemeted syscalls (linux_phys ->
linux_umount2, linux_vm86 -> linux_vm86old, linux_new_vm86 -> linux_vm86).

Change prototype for linux_newuname from `struct linux_newuname_t *' into
`struct linux_new_utsname *'. This change is reflected in linux.h and
linux_misc.c.

Lastly, make line-continuation and indentation more uniform.
1999-08-25 11:17:36 +00:00
Marcel Moolenaar
8ebe972975 Fix stack misalignment for Linux binaries caused by `linux_sigcode' not being
a multiple of 4 bytes in size. This solves the recent SIGBUS errors for
glibc2.1 configurations.

Explained by: bde
1999-08-25 09:05:29 +00:00
Doug Rabson
6afde6e247 Some very minor changes to the ISA dma code. 1999-08-25 08:25:58 +00:00
Mike Smith
68b7d21a4a Rename 'bios_jmp' to 'bios16_jmp' to make it clear what it's related to. 1999-08-25 06:56:37 +00:00
Peter Wemm
857c0cefe0 Use the far jump for the base of the page arithmatic rather than the
calling function, otherwise Bad Things Happen(tm) when bios16_call is
not in the same page as bios_jmp.

Reviewed by:  msmith
1999-08-25 06:44:32 +00:00
Julian Elischer
0ff7b13acd Make DEVFS use PHK's specinfo struct as the source of dev_t and devsw.
In lookup() however it's the other way around as we need to supply the
dev_t for the vnode, so devfs still has a copy of it stashed away.

Sourcing it from the vnode in the vnops however is useful as it makes
a lot of the code almost the same as that in specfs.
1999-08-25 04:55:20 +00:00
Julian Elischer
2053751093 Make DEVFS ops reflect some of the changes that have recently occured in the
specfs version of the same ops. Merging with phk's dev_t changes is not yet
complete.

i.e. devfs still uses it's own devsw pointer rather than following
devsw(a_vp->v_rdev), and it's own copy of the dev_t.

This fixes some broken actions re: syscons and DEVFS due to bitrot in
devfs vops.
1999-08-25 02:04:40 +00:00
Julian Elischer
bb70475a92 Fix comment to match reality..
vop_strategy gets a vnode argument these days.
1999-08-25 00:26:34 +00:00
Julian Elischer
792b73b97b Devfs now adds itself to the hook that PHK supplies.
block devices are still not handled correctly, though a kludge
may make them "ok".
1999-08-24 20:30:15 +00:00