Commit Graph

310 Commits

Author SHA1 Message Date
Dimitry Andric
7617ef9cac Remove superfluous -mno-(mmx|3dnow|sse|sse2|sse3) flags in Makefiles
under sys/boot/{i386,pc98}, since these are already added via
sys/boot/{i386,pc98}/Makefile.inc.

Submitted by:	arundel
2011-01-05 21:46:08 +00:00
Yoshihiro Takahashi
906421ef20 Now there is no functional difference from i386 version.
So use i386 version.
2010-11-13 15:24:56 +00:00
Yoshihiro Takahashi
6d6f513763 MFi386: revision 214210
Avoid using memcpy() for copying 32bit chunks. This shrinks
  the resulting code a little.
2010-10-24 02:59:02 +00:00
Dimitry Andric
d205253515 When building world with clang, for gnu/lib/libobjc, sys/boot/i386/boot2
and sys/boot/pc98/boot2, do not simply assign 'gcc' to CC, since compile
flags are sometimes passed via this variable, for example during the
build32 stage on amd64.  This caused the 32-bit libobjc build on amd64
to fail.

Instead, only replace the first instance of clang (if any, including
optional path) with gcc, and leave the arguments alone.

Approved-by:	rpaulo (mentor)
2010-09-21 21:41:45 +00:00
Dimitry Andric
cd70197aa9 Use a cleaner expression to retrieve the memory size in pc98's boot2.c,
which also avoids NULL pointer arithmetic, as suggested by jhb.  The
available space goes from 11 bytes to 7.

Reviewed by:	nyan
Approved by:	rpaulo (mentor)
2010-09-01 15:24:47 +00:00
Dimitry Andric
227209559d Avoid directly manipulating a NULL pointer (which could result in
undefined behaviour) in sys/boot/pc98/boot2/boot2.c.

Reviewed by:	nyan
Approved by:	rpaulo (mentor)
2010-08-31 18:11:50 +00:00
Dimitry Andric
52e2247273 Always compile pc98 boot2 with gcc instead of clang, just as with i386
boot2.  Unfortunately both still are too big when compiled with clang.

Reviewed by:	nyan
Approved by:	rpaulo (mentor)
2010-08-31 17:38:20 +00:00
Yoshihiro Takahashi
502074f0cf MFi386: revision 210387
Correctly setup LDADD with regards to libstand.
2010-07-25 02:22:32 +00:00
Ed Schouten
d05becf2b6 Use -Wl,-N instead of the undocumented -N option for GCC.
GCC forwards the -N flag directly to ld. This flag is not documented and
not supported by (for example) Clang. Just use -Wl,-N.

Submitted by:	Pawel Worach
2010-06-03 17:42:32 +00:00
Martin Blapp
1457e0cdac Fix typo: s/partion/partition/
Submitted by:	Marc Balmer <marc@msys.ch>
MFC after:	3 days
2010-01-02 17:32:40 +00:00
Yoshihiro Takahashi
02694ba6bc Reimplement the boot2 for pc98 completely.
It's based on the newest i386's one and has the advantage of:

 - ELF binary support.
 - UFS2 filesystem support.
 - Many FreeBSD slices support on a disk.

Tested by:	SATOU Tomokazu ( tomo1770 _ maple _ ocn _ ne _ jp ),
		WATANABE Kazuhiro ( CQG00620 _ nifty _ ne _ jp ) and
		nyan

MFC after:	2 week

Happy New Year in Japan!!
2009-12-31 15:03:33 +00:00
Yoshihiro Takahashi
5c44b2a6b3 Don't use 15M-16M area on pc98. It's reserved for some devices.
MFC after:	2 week
2009-12-31 12:17:38 +00:00
Yoshihiro Takahashi
6925b4bda1 Add setting machine type support to the loader.
MFC after:	2 week
2009-12-31 12:05:48 +00:00
Yoshihiro Takahashi
db5dd5cff8 Move cursor position after putting a character.
MFC after:	1 week
2009-12-21 14:59:23 +00:00
Yoshihiro Takahashi
ef7b7ac106 Fix debug messages of bd_io().
MFC after:	1 week
2009-12-17 13:14:11 +00:00
Yoshihiro Takahashi
36ff75683a Cleanups the boot2 for pc98. There is no functional change.
- Make setting machine type and getting geom conditional for future.
  - Remove unused RAWBOOT and CDBOOT supports.
  - Remove unneeded include.
  - Fix warnings.

MFC after:	1 week
2009-12-11 12:36:59 +00:00
Yoshihiro Takahashi
1a800d321e MFi386: revision 200219
Improve the algorithm the loader uses to choose a memory range for its
  heap when using a range above 1MB.

MFC after:	1 week
2009-12-08 13:06:35 +00:00
Yoshihiro Takahashi
ff85a22cfd MFi386: Use real mode instead of v86 mode.
MFC after:	1 week
2009-12-08 13:04:26 +00:00
Yoshihiro Takahashi
e61de1d24c MFi386: revision 200216
Various small whitespace and style fixes.
2009-12-08 12:10:06 +00:00
Maxim Sobolev
5d695da1d7 Remove spinconsole from pc98, some parts seem to be missed and it's
too late (early?) to figure out what exactly.

Reported by:	TAKAHASHI Yoshihiro
2009-11-27 13:19:06 +00:00
Maxim Sobolev
c4c3b35172 Add new loader console type: "spinconsole". This console selects the
video console which doesn't take any input from keyboard and hides
all output replacing it with ``spinning'' character (useful for
embedded products and custom installations).

Sponsored by:	Sippy Software, Inc.
2009-11-27 03:55:42 +00:00
Yoshihiro Takahashi
e63445f340 MFi386:
Move the loader's entry point to 0x200000.  This change is also needed
for pc98.

MFC after:	3 days
2009-09-13 11:20:17 +00:00
Doug Rabson
cc4757ddef Some of the boot loader code only works on a ufs file system, but it
uses the generic struct dirent, which happens to look identical to UFS's
struct direct.  If BSD ever changes dirent then this will be a problem.

Submitted by:	matthew dot fleming at isilon dot com
2009-05-28 08:22:36 +00:00
Yoshihiro Takahashi
b5ca553462 Oops, fix the previous change. 2009-03-20 13:03:33 +00:00
Yoshihiro Takahashi
d0680af004 MFi386: r189749
Teach the BIOS CD driver to use bounce buffers when the destination
  address is > 1 MB.
2009-03-20 12:26:42 +00:00
Yoshihiro Takahashi
e4cc6edfc1 Merge the missing changes from i386.
Teach the loader about the FAT partitions.
2009-03-20 05:33:58 +00:00
Yoshihiro Takahashi
43d1b8129c MFi386: the part of r179825 to reduce diffs against i386. 2009-03-20 05:21:29 +00:00
Yoshihiro Takahashi
abadd1494d Reduce diffs against i386. 2009-03-19 13:53:42 +00:00
Yoshihiro Takahashi
1214222676 Use the common PC98_MID_* defines instead of a magic number. 2009-03-19 12:33:37 +00:00
Ruslan Ermilov
d9ca85fca7 Fix build when WITH_SSP is set explicitly.
Submitted by:	Jeremie Le Hen
2009-02-21 15:04:31 +00:00
John Baldwin
c22616ec0b - Initialize the vm86 structure to a known-good state. Specifically, always
set the %eflags used during a BIOS call via BTX to 0x202.  Previously
  the flags field was uninitialized garbage, and thus it was "random" if
  interrupts were enabled or not during BIOS calls.
- Use constants from <machine/psl.h> for fields in %eflags.

MFC after:	3 days
2008-08-08 19:41:20 +00:00
Yoshihiro Takahashi
c190805b5d Remove Japanese document. 2008-07-04 12:19:56 +00:00
Ruslan Ermilov
cae17430bf Fix a fallout from SSP commit, and make this compile again.
Bonus: including kern.mk just to pick kernel warning flags
was an extremely bad idea anyway, because it also picked
up CFLAGS (it probably wasn't the case at the time of CVS
rev. 1.1, I haven't checked).  Remove duplicate CWARNFLAGS
from CFLAGS.
2008-06-26 07:56:16 +00:00
Ruslan Ermilov
042df2e2da Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
  turned opt-in for stable branches depending on the consensus.  You
  can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
  It is harmless to steal the knob as SSP symbols have been provided
  by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
  (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
  libc will be automatically downgraded to -fstack-protector because it
  breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by:	Jeremie Le Hen <jeremie@le-hen.org>
2008-06-25 21:33:28 +00:00
Christian Brueffer
662cac9f23 Fix some "in in" typos in comments.
PR:		121490
Submitted by:	Anatoly Borodin <anatoly.borodin@gmail.com>
Approved by:	rwatson (mentor), jkoshy
MFC after:	3 days
2008-03-26 07:32:08 +00:00
Yoshihiro Takahashi
b02402d39a MFi386: revision 1.43
Do not attempt to make an NFS rpc call if using tftp
2008-02-29 05:06:06 +00:00
Yoshihiro Takahashi
8a35feb1e2 MFi386: revision 1.55.
Tweak the verbose disk printing a bit.
2008-02-29 04:56:51 +00:00
Yoshihiro Takahashi
fc4dac79e6 MFi386:
Retire the support for using paging in BTX.  It hasn't been used since
  before 4.0.
2008-02-28 17:33:06 +00:00
Yoshihiro Takahashi
780e069c49 MFi386: revision 1.18
Add a trailing \0 to the read error string so that read errors don't print
  out two error messages.
2007-11-18 03:14:06 +00:00
Yoshihiro Takahashi
34b1e3506c MFi386: part of 1.52
Split the pc98_partition specific routine in bd_opendisk()
into bd_open_pc98().
2007-10-25 14:31:52 +00:00
Yoshihiro Takahashi
91dfd26985 MFi386: part of revision 1.51
Rework the read/write support in the bios disk driver some to cut down
  on duplicated code.
  - All of the bounce buffer and retry logic duplicated in bd_read() and
    bd_write() are merged into a single bd_io() routine that takes an
    extra direction argument.  bd_read() and bd_write() are now simple
    wrappers around bd_io().
2007-10-25 12:57:46 +00:00
Yoshihiro Takahashi
1c44b03ee9 MFi386: revision 1.50
Reindent the read/write code of bd_realstrategy() so it is more readable.
2007-10-24 12:03:48 +00:00
Yoshihiro Takahashi
18a60bb546 MFi386: revision 1.41
Slightly cleanup the 'bootdev' concept on x86 by changing the various
  macros to treat the 'slice' field as a real part of the bootdev instead
  of as hack that spans two other fields (adaptor (sic) and controller)
  that are not used in any modern FreeBSD boot code.
2007-10-24 11:54:04 +00:00
John Baldwin
5c5b5d4607 Slightly cleanup the 'bootdev' concept on x86 by changing the various
macros to treat the 'slice' field as a real part of the bootdev instead
of as hack that spans two other fields (adaptor (sic) and controller)
that are not used in any modern FreeBSD boot code.

MFC after:	1 week
2007-10-24 04:03:25 +00:00
Yoshihiro Takahashi
51626c2003 Optimize for size on pc98. It enables to boot a kernel again.
I don't know what's wrong (loader, boot2 or others), but this change is
effective.

Tested by:	NAKAJI Hiroyuki
MFC after:	3 days
2007-10-15 14:20:24 +00:00
Yoshihiro Takahashi
55ccb0b485 Fix build. 2007-04-07 13:37:45 +00:00
KATO Takenori
f2a081cfe4 Added the IPLware 3.33 support.
- Added magic numbers to pretend the NEC original program version
    2.70.
  - Added string display routine with Shift-JIS code support.
  - Added three nop instructions at start1 in start.s since the
    installaer of the IPLware put 'call $0x09ab' instruction.
  - Put the near return instruction at 0x9ab in selector.s.

Since the Shit-JIS display routine must be located at 0x1243, the
linker script file (ldscript) is applied.
2007-04-07 08:37:04 +00:00
Alexander Kabaev
7d80a3b493 pc98 boot2 is compiled with _KERNEL defined, and that makes non-static
bootinfo variable declaration visible. It conflicts with static
declaration in this file. Declare variable as globally visible in
order to resolve the conflict.
2007-04-06 20:50:24 +00:00
KATO Takenori
8a44b47598 - Moved the uninitialized variables from the data to the bss section.
- Fixed typos in comment.
2007-03-17 05:30:03 +00:00
Yoshihiro Takahashi
a0c908882c MFi386: revision 1.17.
Fix the cdboot twiddle display.
2007-03-04 04:53:17 +00:00
Yoshihiro Takahashi
9c412a61a0 Add a stub of bios_addsmapdata(). PC98 does not have BIOS SMAP. 2006-11-09 08:28:02 +00:00
Yoshihiro Takahashi
0765091d0e MFi386: revisions from 1.39 to 1.43. 2006-11-09 08:05:51 +00:00
Ruslan Ermilov
593bbd2195 Revert the last change. Masking only 2 MSBs of the virtual address
to get the physical address doesn't work for all values of KVA_PAGES,
while masking 8 MSBs works for all values of KVA_PAGES that are
multiple of 4 for non-PAE and 8 for PAE.  (This leaves us limited
with 12MB for non-PAE kernels and 14MB for PAE kernels.)

To get things right, we'd need to subtract the KERNBASE from the
virtual address (but KERNBASE is not easy to figure out from here),
or have physical addresses set properly in the ELF headers.

Discussed with:	jhb
2006-11-02 17:28:38 +00:00
Marcel Moolenaar
932d8c46a2 Extend struct devdesc with a unit field, called d_unit. Promote the
device (kind) specific unit field to the common field. This change
allows a future version of libefi to work without requiring anything
more than what is defined in struct devdesc and as such makes it
possible to compile said version of libefi for different platforms
without requiring that those platforms have identical derivatives
of struct devdesc.
2006-11-02 01:23:18 +00:00
Marcel Moolenaar
5cae408f81 Don't unconditionally compile-in the bcache code. It's only used on
i386/amd64 and pc98. Remove useless calls to bcache_init() from the
ia64 and sparc64 loaders, as well as from the OFW common code.
2006-11-02 00:26:45 +00:00
Ruslan Ermilov
da6d4298b7 Because the BTX mini-kernel now uses flat memory mode and clients
are no longer limited to a virtual address space of 16 megabytes,
only mask high two bits of a virtual address.  This allows to load
larger kernels (up to 1 gigabyte).  Not masking addresses at all
was a bad idea on machines with less than >3G of memory -- kernels
are linked at 0xc0xxxxxx, and that would attempt to load a kernel
at above 3G.  By masking only two highest bits we stay within the
safe limits while still allowing to boot larger kernels.

(This is a safer reimplmentation of sys/boot/i386/boot2/boot.2.c
rev. 1.71.)

Prodded by:	jhb
Tested by:	nyan (pc98)
2006-10-29 14:50:58 +00:00
Tor Egge
a1e363f256 Add mnt_noasync counter to better handle interleaved calls to nmount(),
sync() and sync_fsync() without losing MNT_ASYNC.  Add MNTK_ASYNC flag
which is set only when MNT_ASYNC is set and mnt_noasync is zero, and
check that flag instead of MNT_ASYNC before initiating async io.
2006-09-26 04:15:59 +00:00
Yaroslav Tykhiy
776fc0e90e Commit the results of the typo hunt by Darren Pilgrim.
This change affects documentation and comments only,
no real code involved.

PR:		misc/101245
Submitted by:	Darren Pilgrim <darren pilgrim bitfreak org>
Tested by:	md5(1)
MFC after:	1 week
2006-08-04 07:56:35 +00:00
Yoshihiro Takahashi
33cf0c5194 Add a bootable CD support. 2006-05-14 07:26:02 +00:00
Yoshihiro Takahashi
b42bfe1947 Fix build (s:pc98/cbus/cbus.h:pc98/pc98/pc98_machdep.h:)
Pointyhat to:	nyan
2006-05-09 14:20:17 +00:00
John Baldwin
31062da1b0 Drop the gateA20() function in the loader as it is unused. All the other
boot loaders that load the loader already handle A20.  In fact, they are
required to do so in order to setup the environment that btxldr expects.
2006-04-11 20:11:30 +00:00
Ruslan Ermilov
e1fe3dba5c Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
Yoshihiro Takahashi
6fa7cb4445 MFi386: revisions 1.34 and 1.36. 2005-12-21 06:10:42 +00:00
Yoshihiro Takahashi
8b891b8d17 MFi386: revision 1.8. 2005-12-21 06:09:47 +00:00
Yoshihiro Takahashi
2d908c8204 MFi386: revision 1.46. 2005-12-21 06:09:09 +00:00
Maxim Sobolev
90ec8e27c3 Unbreak pc98 after my last changes to i386. 2005-12-20 08:54:30 +00:00
Yoshihiro Takahashi
94ac50dbcb MFi386: Enable beastie.4th. 2005-10-30 15:59:08 +00:00
Yoshihiro Takahashi
f51b0ce0ee MFi386: revision 1.33.
> Cause all flags passed by boot2 to set the respective loader(8)
  > boot_* variable.  The end effect is that all flags from boot2
  > are now passed to the kernel.
2005-09-30 13:24:14 +00:00
Yoshihiro Takahashi
42244f27c2 Remove EPSON PC-386 note A/W/AE/WR support. 2005-09-14 12:39:06 +00:00
Yoshihiro Takahashi
abf04270da MFi386: revision 1.11. 2005-09-13 08:29:03 +00:00
Yoshihiro Takahashi
090559c76e MFi386: revisions 1.10 and 1.11.
- Add '-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3' to CFLAGS.
2005-09-13 08:27:38 +00:00
John Baldwin
8b7c03a7a4 - Add support to the loader for multiple consoles.
- Teach the i386 and pc98 loaders to honor multiple console requests from
  their respective boot2 binaries so that the same console(s) are used in
  both boot2 and the loader.
- Since the kernel doesn't support multiple consoles, whichever console is
  listed first is treated as the "primary" console and is passed to the
  kernel in the boot_howto flags.

PR:		kern/66425
Submitted by:	Gavin Atkinson gavin at ury dot york dot ac dot uk
MFC after:	1 week
2005-05-27 19:31:00 +00:00
John Baldwin
5b09b18204 Print out the commands from /boot.config after parsing them so that they
output is sent to the correct console(s).

PR:		kern/66425
Submitted by:	Gavin Atkinson gavin at ury dot york dot ac dot uk
MFC after:	1 week
2005-05-27 19:26:11 +00:00
Yoshihiro Takahashi
d1725ef7ff Change a directory layout for pc98.
- Move MD files into <arch>/<arch>.
  - Move bus dependent files into <arch>/<bus>.
Rename some files to more suitable names.

Repo-copied by:	peter
Discussed with:	imp
2005-05-10 12:02:18 +00:00
Yoshihiro Takahashi
769f92857b Remove ifdef PC98. 2005-05-08 14:17:28 +00:00
Yoshihiro Takahashi
d03f4aa4fe Merged from libi386/biosdisk.c revisions 1.37 and 1.41. 2005-05-08 13:30:14 +00:00
Yoshihiro Takahashi
ad42c2a5fd Use DOSMID_386BSD rather than DOSPTYP_386BSD. 2005-05-08 11:15:38 +00:00
Yoshihiro Takahashi
fa1650c0c8 MFi386: revision 1.20. 2005-04-14 14:12:54 +00:00
Warner Losh
722cb08d74 Fix buidling of boot blocks for pc98 with new links.
Submitted by: nyan@
2005-04-03 04:58:15 +00:00
Ruslan Ermilov
cbbdcac72a NOFORTH -> NO_FORTH 2004-12-21 12:32:15 +00:00
Ruslan Ermilov
83c7ade90a NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Scott Long
05d0bf79ed Remove the last vestiges of the userconfig option. None of this actually
did anything, so this commit should be considered a NO-OP.
2004-12-01 04:59:33 +00:00
Yoshihiro Takahashi
cafe28f16a MFi386: revisions 1.77 and 1.78. 2004-11-29 11:55:14 +00:00
Yoshihiro Takahashi
028d40a592 MFi386: revision 1.38. 2004-11-29 11:54:42 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Yoshihiro Takahashi
c25984c97c MFi386: revision 1.4. 2004-10-24 12:16:18 +00:00
Yoshihiro Takahashi
3ad0b93804 MFi386: Set bi_basemem and bi_extmem variables.
Respect RB_MULTIPLE flag.
2004-10-24 12:15:07 +00:00
Yoshihiro Takahashi
8c3c8ed197 MFi386: Add support for preloading ELF relocatable object format modules. 2004-10-24 12:14:05 +00:00
Ruslan Ermilov
69a02bda38 Document boot_cdrom, boot_multicons, and boot_serial.
Reduce diffs between help.common and loader(8).
Mention that boot_userconfig is currently a no-op.
2004-09-30 13:09:00 +00:00
Yoshihiro Takahashi
cede9ec016 MFi386: revision 1.56 (Add -fno-unit-at-a-time to CFLAGS). 2004-09-18 00:12:04 +00:00
Yoshihiro Takahashi
c80f54d479 Fix new compiler error (s/bcopy/memcpy/). 2004-07-30 09:42:04 +00:00
Poul-Henning Kamp
1400886b92 Fix another beak.
Seen by:	pjd
2004-06-17 11:44:05 +00:00
Poul-Henning Kamp
ad165b6f6d Unspam sys/boot, the dev_t commit should not have touched these.
Spotted by:	peter
2004-06-16 18:21:22 +00:00
Poul-Henning Kamp
0e69b1a1c7 My new keyboard can't spell. 2004-06-16 17:03:18 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
4ee9ad6b13 Premptively fix GCC3.4 issue: add break; after empty default: clauses.
PR:	65493
Submitted by:	Pawel Worach <sajd@telia.com>
2004-06-16 08:12:06 +00:00
Yoshihiro Takahashi
dd4d0b14e8 MFi386: revisions from 1.15 to 1.17. 2004-04-29 08:24:57 +00:00
Yoshihiro Takahashi
798f9e7fa0 MFi386: revisions from 1.16 to 1.18. 2004-04-29 08:24:30 +00:00
Ruslan Ermilov
1e104f00e7 MFi386: Use C (and CPP) style comments for assembler-with-cpp
sources, for lines that start with a comment.
2004-04-28 10:15:31 +00:00