Commit Graph

6461 Commits

Author SHA1 Message Date
Poul-Henning Kamp
02e1576966 Make bdev userland access work like cdev userland access unless
the highly non-recommended option ALLOW_BDEV_ACCESS is used.

(bdev access is evil because you don't get write errors reported.)

Kill si_bsize_best before it kills Matt :-)

Use the specfs routines rather having cloned copies in devfs.
1999-08-30 07:56:23 +00:00
Bruce Evans
4047cd0bb2 Converted the silly SAFTEY option into a new-style option by renaming it to
DIAGNOSTIC.

Fixed an English style bug in the panic messages controlled by SAFETY.
1999-08-30 07:08:04 +00:00
Mitsuru IWASAKI
c610e9fe39 ident GENERIC -> ident PCCARD
Okayed by:	hosokawa
1999-08-29 16:58:40 +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
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
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
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
94db13fe98 Fix various trivial warnings from LINT 1999-08-28 19:44:07 +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
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
Peter Wemm
2185977908 Regen after Id->FreeBSD 1999-08-28 02:35:56 +00:00
Peter Wemm
280652828b $Id$ -> $FreeBSD$ 1999-08-28 02:16:32 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +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
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
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
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
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
Marcel Moolenaar
ae4ea3eed4 Use ALIGN_TEXT macro for alignment to avoid ambiguity.
Pointed out by: bde
1999-08-25 19:04:39 +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
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
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
Poul-Henning Kamp
c1df7a7420 Remove unneeded prototypes. 1999-08-24 18:31:06 +00:00
Mike Smith
e6a80efcdd Work around a bad design in some PnP BIOS code whereby the BIOS can reach
off the top of our constructed stack segment while it's trying to copy a
maximally-sized PnP argument frame around.
1999-08-24 16:42:08 +00:00
Alan Cox
4bffe072c4 Cosmetic: Correct the Id string.
Submitted by:	Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
1999-08-24 06:54:20 +00:00
Bruce Evans
d009ccfaf5 Cast pointers to uintptr_t instead of casting them to u_long, and/or vice
versa.  Cosmetic.
1999-08-24 00:56:50 +00:00
Bruce Evans
917210006a Fixed a misplaced cast to uintptr_t. Cosmetic.
Use device_get_nameunit() instead of rolling our own.
1999-08-24 00:22:10 +00:00
Bruce Evans
709db0871d `bootdev' is an ordinary u_long, so don't cast it to a pointer to print it.
gcc warns about the cast on i386's with 64-bit longs.

Print `bootdev' in all cases when we bail out because it is unreasonable.
1999-08-23 23:42:00 +00:00
Alan Cox
1971432659 Implement a version of s_lock_try that doesn't cause the next s_lock
call to panic when SL_DEBUG is set.  (SL_DEBUG is currently set
by default.)
1999-08-23 22:25:11 +00:00
Poul-Henning Kamp
845e0781ec Now that we can bind cdevsw to the individual dev_t, divorce the PERFMON
stuff from mem.c.  If PERFMON is there, it will "steal" a minor from
mem.c, but mem.c doesn't need to know about this.

Fixed type of cmd argument in perfmon_ioctl().
1999-08-23 21:34:23 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Bruce Evans
d918320517 Use devtoname() to print dev_t's instead of casting them to long or u_long
for misprinting in %lx format.
1999-08-23 20:35:21 +00:00
Peter Wemm
80e6247e72 The nexus_attach() code works a lot better if it's actually connected to
the device methods... Also, don't fail to add eisa/isa because a previous
device failed to attach.
1999-08-23 19:23:33 +00:00
Alan Cox
a236cb64a9 Modify the macros IMASK_UNLOCK, CPL_UNLOCK, and REL_FAST_INTR_LOCK
to perform the s_unlock inline.
1999-08-23 19:14:18 +00:00
KATO Takenori
614926e47a - Make binary size smaller.
- Fix typo in TDK/LANX stuff.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1999-08-23 13:54:35 +00:00
Peter Wemm
a5a9efa92b The previous fix didn't do anything if you didn't have pnp. The ICU
macros are only called in the !APIC_IO case, include icu.h there.
1999-08-22 23:49:00 +00:00
Brian Feldman
1574a39bd2 Finish unbreaking autoconf.c includes (for non-SMP.) 1999-08-22 23:44:33 +00:00
Peter Wemm
2237f6ec54 Oops, that wasn't so clever after all. struct isa_device is still a
prerequisite for this old pnp.h.
1999-08-22 21:44:35 +00:00
Peter Wemm
be5890825d Zap a heap of unused cruft now. We don't need the ISA/EISA/PCI hooks
here any more as they are self identifying.  Only PNP remains but that
will be replaced any day now.
Also reword a comment that had been XXX'ed to death to make it clear[er]
why we don't enable interrupts before probing.
PCIBIOS interrupt routing controls may make this possible to fix one day.
1999-08-22 19:59:29 +00:00
Peter Wemm
ca29e71c56 Take advantage of the apm/npx code and let them identify themselves rather
than having explicit hooks here.
Treat the eisa/isa attach a little differently so that we defer the
decision about to attach eisa/isa to the motherboard directly only if
the PCI probe (if it exists) fails to turn up a PCI->EISA/ISA bridge.
This restores the original device geometry where ISA and/or EISA attach
to their bridge rather than bypassing and going to the root.
1999-08-22 19:56:55 +00:00
Peter Wemm
f3b63bd388 Make the identify routine add itself with priority 100 to make sure it
goes after the npx/apm devices and any other motherboard devices that
may get added down the track.
1999-08-22 19:54:11 +00:00