Commit Graph

89229 Commits

Author SHA1 Message Date
Peter Wemm
48a0b96a50 Enable the i386 loader to load and run an amd64 kernel. If this puts
things over floppy size limits, I can exclude it for release builds or
something like that.  Most of the changes are to get the load_elf.c file
into a seperate elf32_ or elf64_ namespace so that you can have two
ELF loaders present at once.  Note that for 64 bit kernels, it actually
starts up the kernel already in 64 bit mode with paging enabled.  This
is really easy because we have a known minimum feature set.

Of note is that for amd64, we have to pass in the bios int 15 0xe821
memory map because once in long mode, you absolutely cannot make VM86
calls.  amd64 does not use 'struct bootinfo' at all.  It is a pure loader
metadata startup, just like sparc64 and powerpc.  Much of the
infrastructure to support this was adapted from sparc64.
2003-05-01 03:56:30 +00:00
Alan Cox
ab7b0ae578 Lock an update to a vm_object's ref_count. 2003-05-01 03:51:05 +00:00
Peter Wemm
cda4b241e2 Hack to enable getting two different elf32 and elf64 loaders in the
same i386 loader binary.
2003-05-01 03:46:12 +00:00
Peter Wemm
e7d32e949b <b30> is 'IA64' - ie: you're running on an ia64 in 32 bit mode. 2003-05-01 03:44:40 +00:00
Hidetoshi Shimokawa
e47276e59c Fix printf warning caused by recent CAM change. 2003-05-01 03:38:04 +00:00
Peter Wemm
161af19be7 Back out last commits. The elf64/elf32 kernel name thing was more pain
than it was worth.
2003-05-01 03:33:28 +00:00
Peter Wemm
7f47668191 Slight reorg and added AMD64 support. A couple of the MODINFOMD_* values
that were added to sparc64 and later powerpc, really should have been in
the MI area.  But changing that now with insufficient preperation will
just cause too much pain.

Move MD_FETCH() to the MI sys/linker.h file to avoid another two copies
of it.
2003-05-01 03:31:18 +00:00
Alan Cox
1534781737 - Update the vm_object locking in vm_object_reference().
- Convert some dead code in vm_object_reference() into a comment.
2003-05-01 03:29:20 +00:00
Alan Cox
ebba1b25f9 Lock accesses to the vm_object's ref_count and resident_page_count. 2003-05-01 03:10:38 +00:00
Peter Wemm
b05deb9bc1 Sync up with the files in the hammer branch in the p4 tree to get basic
AMD64 support.  There is still more to add.
2003-05-01 02:59:24 +00:00
Tim J. Robbins
005197bb40 Add the -j and -y options to the synopsis. 2003-05-01 02:37:46 +00:00
Tim J. Robbins
aef4bb33e5 Flush streams before calling system() so that the output appears in the
right place in the output stream when redirected to a file (when full
buffering is enabled). Noticed by schweikh on freebsd-standards.
2003-05-01 02:36:27 +00:00
Marcel Moolenaar
b52e9eb6b6 Don't emulate a MBR by handling the MBR::type attribute. It is
not needed at all. The BSD class will attach to a GPT class without
it.
2003-05-01 01:51:28 +00:00
Greg Lehey
c44e61c6cb Add the #includes previously in individual .c files.
Change name of history file to History to avoid name conflicts.
2003-05-01 01:40:16 +00:00
Greg Lehey
d82c72d742 Move most #includes to vext.h.
Change name of history file to History to avoid name conflicts.

Don't try to make devices unless devfs has been removed.

Don't accept resetconfig command from a file.

Abused by:  Jens Schweikhardt <schweikh@schweikhardt.net>

Remove dead code (#if 0)

vinum_mirror: Don't try to create mirrors with 0 drives.

Found by: mismatch between enum kw in two different files.
2003-05-01 01:39:49 +00:00
Greg Lehey
807b7ff353 Move most #includes to vext.h.
Change name of history file to History to avoid name conflicts.

Rewrite minor number decoding.  Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

Don't try to chown directories if they haven't been created.
2003-05-01 01:39:42 +00:00
Greg Lehey
3b967ba7e9 Move most #includes to vext.h.
vinum_info: Use increasing verbosity to show time spent in disk
	    driver.

Correct a comment.
2003-05-01 01:38:55 +00:00
Greg Lehey
03c03f6cf4 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).
2003-05-01 01:35:03 +00:00
Greg Lehey
bf7cea1cc0 For consistency's sake, on command failure, throw 1, not -1.
Rewrite minor number decoding.  Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).
2003-05-01 01:34:38 +00:00
Greg Lehey
0910419967 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

Correct formats for some error messages.  Don't cast the value to
match the format.
2003-05-01 01:34:05 +00:00
Greg Lehey
9ebe817222 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

Tidy up comments.

Check for null rqgs.  This continue to be reported, though I can't
work out why.

Correct formats for some error messages.  Don't cast the value to
match the format.

Use microtime, not getmicrotime, for timing debug entries.
2003-05-01 01:33:34 +00:00
Greg Lehey
f77547fbbb Terminate a comment. 2003-05-01 01:33:01 +00:00
Greg Lehey
9351e5dbcc Don't make definition of kw_debug dependent on VINUMDEBUG. In
userland, define the keyword even if the kernel module doesn't have
debug code.
2003-05-01 01:32:31 +00:00
Greg Lehey
25d8d1f1a9 Use strrchr, not rindex. This is for compatibility with other
systems, and requires a #define.
2003-05-01 01:32:08 +00:00
Greg Lehey
130101dd9d #ifdef VINUMDEBUG, not #if VINUMDEBUG. 2003-05-01 01:31:48 +00:00
Greg Lehey
de7d0dd0eb Don't make definition of kw_debug dependent on VINUMDEBUG. It's only
an enum value, and dropping it can lead to some spectacular surprises
in userland.
2003-05-01 01:31:20 +00:00
Greg Lehey
01fbffad0e Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

As a result of the minor number changes, split out the superdevice
handling into a separate function, vinum_super_ioctl.  This was most
of the code of vinumioctl.

attachobject: Improve error checking.
2003-05-01 01:30:59 +00:00
Greg Lehey
9488925d66 Use microtime, not getmicrotime, for timing debug entries.
init_drive: Rephrase error message text.
	    Remove dead code (inside #if 0).

Change name of find_drive_by_dev to the more descriptive
find_drive_by_name.

Tidy up comments.
2003-05-01 01:30:31 +00:00
Greg Lehey
d55f8bc42e Remove "to do" comments.
get_emppty_drive: Fix a day one bug with strcpy parameters.

Change name of find_drive_by_dev to the more descriptive
find_drive_by_name.

Rewrite minor number decoding.  Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).
2003-05-01 01:29:52 +00:00
Greg Lehey
47f9c49661 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

Remove an unnecessary goto.

vinumopen: Return EINVAL, not ENXIO, on an attempt to open a
referenced plex.
2003-05-01 01:28:42 +00:00
Peter Wemm
afa8862328 Commit MD parts of a loosely functional AMD64 port. This is based on
a heavily stripped down FreeBSD/i386 (brutally stripped down actually) to
attempt to get a stable base to start from.  There is a lot missing still.
Worth noting:
- The kernel runs at 1GB in order to cheat with the pmap code.  pmap uses
  a variation of the PAE code in order to avoid having to worry about 4
  levels of page tables yet.
- It boots in 64 bit "long mode" with a tiny trampoline embedded in the
  i386 loader.  This simplifies locore.s greatly.
- There are still quite a few fragments of i386-specific code that have
  not been translated yet, and some that I cheated and wrote dumb C
  versions of (bcopy etc).
- It has both int 0x80 for syscalls (but using registers for argument
  passing, as is native on the amd64 ABI), and the 'syscall' instruction
  for syscalls.  int 0x80 preserves all registers, 'syscall' does not.
- I have tried to minimize looking at the NetBSD code, except in a couple
  of places (eg: to find which register they use to replace the trashed
  %rcx register in the syscall instruction).  As a result, there is not a
  lot of similarity.  I did look at NetBSD a few times while debugging to
  get some ideas about what I might have done wrong in my first attempt.
2003-05-01 01:05:25 +00:00
Peter Wemm
4580c352e1 KPT_MIN_ADDRESS and KPT_MAX_ADDRESS are not used anywhere. And if they
were, they are not safe to use outside of the kernel since these values
can change at kernel compile time - ie: we do not want them compiled into
userland binaries.
2003-05-01 00:10:38 +00:00
Marcel Moolenaar
367165975d Kill MID_MACHINE, its a.out specific, the only platform that supports
it is i386. All of the other platforms should remove it too.
	-- peter@
2003-04-30 23:16:33 +00:00
Peter Wemm
1e57e9eba3 Repocopy from x86_64/... to amd64/...
Rename visible x86_64 references to amd64.
Kill MID_MACHINE, its a.out specific, the only platform that supports it
is i386.  All of the other platforms should remove it too.
2003-04-30 22:51:59 +00:00
Peter Wemm
a15febf91b Add AMD64 hooks 2003-04-30 22:22:29 +00:00
Maxim Sobolev
e9442e03ca Add support for IC Book Ironclad Pro/Lite 8-port cards.
Sponsired by:	IC Book Labs
MFC After:	2 weeks
2003-04-30 22:15:47 +00:00
Peter Wemm
5dacb0cdba We use i386 boot code on AMD64. 2003-04-30 22:13:36 +00:00
Peter Wemm
1de0385cfc Fix transcription error. Use == NULL, not != NULL. Fortunately this
was harmless.
2003-04-30 22:09:26 +00:00
Peter Wemm
7c2063f710 Use the 64 bit sized struct kinfo_proc for AMD64. 2003-04-30 22:06:39 +00:00
Peter Wemm
dae0bca875 Look for an elf32 kernel (powerpc) and elf64 kernel (sparc64) as well
as a plain "elf kernel".
2003-04-30 22:05:48 +00:00
Peter Wemm
d6d3ae55c3 ACPI will always be present on AMD64 - it will never be an autodetect
module.
2003-04-30 22:02:39 +00:00
Peter Wemm
145b0eb56d Also look for an "elf64 kernel" (for sparc64) and "elf32 kernel" (for
powerpc) when building metadata.
2003-04-30 22:00:16 +00:00
Mark Murray
daf509c612 The PAM module pam_krb5 does not have "session" capabilities.
Don't give examples of such use, this is bogus.
2003-04-30 21:57:54 +00:00
Peter Wemm
cb1f265c60 AMD64 uses the new-style cpu_switch()/cpu_throw() calling conventions. 2003-04-30 21:45:03 +00:00
Peter Wemm
0eb8d2e84a Create a 'legacy' node for AMD64 as well as i386. While we'll never
have to use it since all AMD64 machines are supposed to have acpi etc,
I'm using it during development so I can avoid the acpi code for now.
Yes, this is cheating.
2003-04-30 21:41:41 +00:00
Peter Wemm
8c027ecbba Eliminate a compiler warning with gcc3.3 on AMD64, where speed is
a 32 bit int which can never be > ULONG_MAX / 8.  Its an 'always true'
warning.
2003-04-30 21:39:28 +00:00
Mark Murray
aab6741f7e More factual updates for kerberos 5. 2003-04-30 21:15:41 +00:00
Peter Wemm
7c1622ff28 Remove 80386 bandaids from code repocopied from i386. rtld_start.S still
todo.
2003-04-30 21:09:06 +00:00
Peter Wemm
8e80f8a438 AMD64 support (another IEEEFP platform) 2003-04-30 21:06:30 +00:00
Peter Wemm
a1de871d26 AMD64 support; repocopied from i386 2003-04-30 21:05:33 +00:00