aboutsummaryrefslogtreecommitdiff
path: root/sys/boot
Commit message (Collapse)AuthorAgeFilesLines
...
* The exit() function has been moved to libefi.c to better deal withMarcel Moolenaar2002-12-101-39/+0
| | | | | | | | | | cleaning up after ourselves. Approved by: re (blankoscheck) German corrections: Alexander (both :-) Notes: svn path=/head/; revision=107724
* Change the startup code to fix a memory leak and to allow us toMarcel Moolenaar2002-12-105-41/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accept load options (=command line options). The call graph changes from *entry*->efi_main->efi_init, where efi_main is the EFI equivalent of main to *entry*->efi_main->main, where main is what you'd expect. efi_main now is what efi_init was. The prototype of main follows that of C. The first argument is argc and the second is argv. There is no third argument. Allocation of heap pages is now handled by the EFI library and it now deallocates the pages when main() returns or when exit() is called. This allows us to safely return to the boot manager (or EFI shell) without leaks. EFI applications are responsible to free all memory themselves. Handling of the load options is a bit tricky. There are either no load options, load options in ASCII or load options in Unicode. The EFI library will translate the ASCII options to Unicode options as to simplify user code. Since the load options are passed as a single string (if present) and main() accepts argc and argv, the startup code also has to split the string into words and build the argv vector. Here the trickiness starts. When the loader is started from the EFI shell, argv[0] will automaticly load the program name. In all other cases (ie through the boot manager), this is not the case. Unfortunately, there's no trivial way to check. Hence, a set of conditions is checked to determine if we need to fill in argv[0] ourselves or not. This checking is not perfect. There are known cases where it fails to do the right thing. The logic works for most expected cases, though. This includes the case where no options are given. Approved by: re (blanket) Notes: svn path=/head/; revision=107723
* o Make all GUID variables global to maximize reuse.Marcel Moolenaar2002-12-102-42/+64
| | | | | | | | | | o Recognize the HCDP configuration table. o Dump the GUID of tables we don't recognize. Approved by: re (carte blanche) Notes: svn path=/head/; revision=107722
* Build EFI with -fshort-wchar so that L"some string" works with theMarcel Moolenaar2002-12-101-1/+1
| | | | | | | EFI has defined CHAR16. Notes: svn path=/head/; revision=107721
* Remove _putchar, _puts and _puthex. These functions are unused.Marcel Moolenaar2002-12-102-202/+4
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=107720
* Add the GUID of the DIG64 HCDP table.Marcel Moolenaar2002-12-081-0/+3
| | | | Notes: svn path=/head/; revision=107686
* The boot manager sets the watchdog timer to 5 minutes before invokingMarcel Moolenaar2002-12-082-12/+20
| | | | | | | | | | | | | | | | | | | | | | a boot option. When the timer expires the machine is rebooted. Disable the watchdog timer for 2 reasons: o We're an interactive program. We cannot guarantee that we've booted the kernel in the time available to us. There have been situations where netbooting the right kernel took 2 tries and more time than given. Not to speak of the normal behaviour to have the loader sitting at the prompt while the user is off doing other things (such as figuring out what to type next ;-) o We may not boot a kernel at all. We may exit as the result of the user typing quit (assuming it took less than 5 minutes to type it :-). It is documented that loaders should have disabled the watchdog timer if they return to the boot manager. Not doing so would cause a reboot while in the boot manager. This appears to be harmless, besides of course the actual reboot. Approved by: re (weisse karte) Notes: svn path=/head/; revision=107683
* In efi_cons_poll we check if a key is present (pending) by checkingMarcel Moolenaar2002-12-081-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | the signaled state of the apropriate event. As a side-effect of checking the event, it's signaled state is cleared if it was set. In efi_cons_getchar we used to wait for the apropriate event to be signaled before reading a character. This however does not work if we poll before reading the characteri, such as during autoboot. On a more compliant EFI implementation this resulted in the behaviour that hitting a key during autoboot would stop the countdown, but would then wait for a new character to arrive instead of reading the already pending key that stopped the countdown. The correct behaviour for efi_cons_getchar is to try to read a key and if none is pending, to wait for the apropriate event to signal the arrival of a new key. Note that with the previous behaviour, the second key would determine how the autoboot was interrupted. This would indicate that the first key got lost. This indicates that EFI does not necessarily maintain a queue of pending keys. FWIW... Approved by: re (carte blanche) French corrected by: various people :-) Notes: svn path=/head/; revision=107682
* Fix a dumb bug that broke net booting on sparc64. The wrong length wasJake Burkholder2002-12-021-1/+1
| | | | | | | | | | | passed to strncmp. Noticed by: tmm Approved by: re Pointy hat to: jake Notes: svn path=/head/; revision=107483
* Remove a left-over virtual mapping of uncached I/O port space.Marcel Moolenaar2002-11-284-34/+6
| | | | | | | | | | | | | | | | Previous kernels unwantingly depended on this mapping, but as of version 1.123 of src/sys/ia64/ia64/machdep.c this dependency has been removed. Consequently, one has to update the kernel before updating the loader. The documented/recommended upgrade will suffice in this case. Due to a visible (from the kernels point of view) change in behaviour, bump the loader version number from 0.3 to 1.0. Approved by: re (carte blanc) Notes: svn path=/head/; revision=107367
* Enable UFS2 support in boot1. Just as with sparc64 the same boot1 worksJohn Baldwin2002-11-271-1/+0
| | | | | | | | | great with both UFS1 and UFS2 filesystems. Approved by: re Notes: svn path=/head/; revision=107352
* Create a new 32-bit fs_flags word in the superblock. Add code to moveKirk McKusick2002-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | the old 8-bit fs_old_flags to the new location the first time that the filesystem is mounted by a new kernel. One of the unused flags in fs_old_flags is used to indicate that the flags have been moved. Leave the fs_old_flags word intact so that it will work properly if used on an old kernel. Change the fs_sblockloc superblock location field to be in units of bytes instead of in units of filesystem fragments. The old units did not work properly when the fragment size exceeeded the superblock size (8192). Update old fs_sblockloc values at the same time that the flags are moved. Suggested by: BOUWSMA Barry <freebsd-misuser@netscum.dyndns.dk> Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=107294
* Eliminate references to defunct kernel tunables.Yaroslav Tykhiy2002-11-263-24/+0
| | | | | | | | Approved by: re PR: bin/43343 Notes: svn path=/head/; revision=107266
* MFp4:Marcel Moolenaar2002-11-242-10/+48
| | | | | | | | | | | | o Show the contents of the AP wakeup descriptor when dumping SAL information. o Increase S/N ratio when listing the itr and dtr. Only show valid mappings and give the total number of TRs. Approved by: re (blanket) Notes: svn path=/head/; revision=107203
* The new "all sound drivers" driver name is snd_driver. Loader.conf didn'tDaniel C. Sobral2002-11-221-1/+1
| | | | | | | | | knew about it, though. Now it does. MFC after: 2 weeks Notes: svn path=/head/; revision=107175
* Document loader tunables hw.pci.enable_io_modes andMatthew N. Dodd2002-11-132-0/+24
| | | | | | | | | | hw.pci.allow_unsupported_io_range. Submitted by: Hiten Pandya <hiten@angelica.unixdaemons.com> Approved by: re (murray) Notes: svn path=/head/; revision=106845
* Loader tunable 'machdep.disable_mtrrs'.Matthew N. Dodd2002-11-132-0/+6
| | | | | | | | | | | Sysctl of same name to reflect status. Submitted by: jhb Approved by: re (murray) MFC after: 1 day Notes: svn path=/head/; revision=106842
* Change the device path representation in libofw to use the full firmwareJake Burkholder2002-11-1011-647/+93
| | | | | | | | | | | | path, instead of an internal i386 specific one. Don't try to interpret a disklabel in ofw_disk.c, open the partition's device node directly and let the firmware do it. This fixes booting from a partition other than 'a' on sparc64, which is needed to support more installation methods. No objection: ppc Notes: svn path=/head/; revision=106738
* Correctly recognize both bogus and genuine BSD disklabels.Poul-Henning Kamp2002-11-031-1/+4
| | | | | | | | | Don't expect me to participate in a discussion which is which. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=106385
* Fix indentation of comments.Jonathan Mini2002-11-021-17/+17
| | | | Notes: svn path=/head/; revision=106335
* Add loader variables to control the loading of various networking modules.Jonathan Mini2002-11-021-0/+31
| | | | | | | Submitted by: David Yeske <dyeske@yahoo.com> Notes: svn path=/head/; revision=106330
* o Fix a size calculation based on a 8KB page, while under EFIMarcel Moolenaar2002-10-245-33/+71
| | | | | | | | | | | | | | | pages are 4KB. o As a second order fix, don't assume we have enough space after the bootinfo block left in a page to hold the memory map. o A third order fix as that we removed the assumption that a bootinfo block fits in a single 8KB page. PR: ia64/39415 submitted by: Espen Skoglund <esk@ira.uka.de> Notes: svn path=/head/; revision=105852
* Pass the right number of tlb slots to the kernel. The allocation schemeThomas Moestl2002-10-181-10/+4
| | | | | | | | | | was changed in r1.4, but I neglected to update most of the code in metadata.c. Pointy hat to: tmm Notes: svn path=/head/; revision=105427
* Compile in support for zipfs and bzipfs so we can load the gzipped mfsrootJake Burkholder2002-10-132-0/+14
| | | | | | | that releases use. Notes: svn path=/head/; revision=105065
* Remove '-DUFS1_ONLY' from CFLAGS. It is not needed.Yoshihiro Takahashi2002-10-101-2/+0
| | | | Notes: svn path=/head/; revision=104777
* Revert MEM_USR back to 0xa000 for BTX clients. Instead, adjust boot2John Baldwin2002-10-088-18/+18
| | | | | | | | | | to run at 0xc000 by changing its virtual start address from 0x1000 to 0x2000. Tested by: phk Notes: svn path=/head/; revision=104683
* Now that ufsread.c doesn't do 64bit divide remainder operations,Poul-Henning Kamp2002-10-082-30/+4
| | | | | | | | | don't bother with libkern. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104680
* Save a couple of bytes by not returning ints nobody care about.Poul-Henning Kamp2002-10-082-12/+12
| | | | | | | Sponsored by: DARPA & NAI labs Notes: svn path=/head/; revision=104679
* It seems that the only problem with UFS2 booting on i386 is the 64bitPoul-Henning Kamp2002-10-081-10/+12
| | | | | | | | | | | | divide/remainder calls. For reasons not resolved, compiling the relevant routines from libkern into boot2 results in stack corruption. Do the simple thing: Don't use 64bit divide/remainder operations. Sponsored by: DARPA & NAI Labs Notes: svn path=/head/; revision=104678
* Reinstate rev 1.36 with an important line that got missed. Note thisBrian Feldman2002-10-082-4/+10
| | | | | | | | also improves the "random undocumented offsets into various memory spaces" a little bit. Notes: svn path=/head/; revision=104673
* Remove unused TYPE_WD and TYPE_WFD.Poul-Henning Kamp2002-10-082-4/+0
| | | | Notes: svn path=/head/; revision=104671
* Correctly calculate dmadat: We need to take the address of _end, it'sPoul-Henning Kamp2002-10-082-2/+2
| | | | | | | | | | contents is irrelevant and likely to be zero; This doesn't change the resultant value, but it does save a couple of bytes because &_end is constant. Notes: svn path=/head/; revision=104670
* Unbreak boot2 by backing out rev 1.36 to Makefile, which does notPoul-Henning Kamp2002-10-082-6/+2
| | | | | | | | | | | | | | | | | | | | | work as advertised: bang# pwd /bang/src/sys/boot/i386/boot2 bang# make clean >& /dev/null bang# cvs -q update -r 1.35 Makefile >& /dev/null bang# make >& /dev/null bang# cat /usr/obj/`pwd`/boot2.h #define XREADORG 0x725 bang# cvs -q update -r 1.36 Makefile > & /dev/null bang# make clean > & /dev/null bang# make > & /dev/null bang# cat /usr/obj/`pwd`/boot2.h #define XREADORG 0x25 bang# Notes: svn path=/head/; revision=104668
* Save four bytes by shortening a string two chars.Poul-Henning Kamp2002-10-082-4/+2
| | | | | | | Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104666
* Correct a bug in adding 0x700 to a number.Brian Feldman2002-10-072-2/+6
| | | | Notes: svn path=/head/; revision=104636
* Conditionalize the number of sectors loaded by boot1.s on UFS1/UFS12.Poul-Henning Kamp2002-10-076-12/+84
| | | | | | | | | | | Conditionalize the "XX bytes left" checks reference on UFS1/UFS12. Conditionally build the necessary 64bit math for boot2 if UFS12. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104635
* Change the comment character from # to // in boot1.s and runPoul-Henning Kamp2002-10-074-646/+648
| | | | | | | | | it through CPP so we can conditionalized things. Sponsored by: DARPA & NAI Labs Notes: svn path=/head/; revision=104632
* Correctly adjust for moved start address.Poul-Henning Kamp2002-10-072-2/+2
| | | | | | | | | | | It seems that the existence of a "depend" target in src/sys/boot is not to be taken as an indication that it actually does what one would expect, at least it clearly threw my testing off. Apologies to: jhb Notes: svn path=/head/; revision=104629
* Added '#include <sys/diskpc98.h>'.Yoshihiro Takahashi2002-10-071-0/+1
| | | | | | | Submitted by: kawanobe@st.rim.or.jp (Kawanobe Koh) Notes: svn path=/head/; revision=104621
* Correctly compensate for both offset and unoffset on-disk BSD disklabels.Poul-Henning Kamp2002-10-072-2/+4
| | | | | | | Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104620
* Move MEM_USR a page upwards to make space for larger UFS1 boot2.Poul-Henning Kamp2002-10-074-10/+10
| | | | | | | | | | Load 4 sectors more than we used to. This is harmless overhead for the UFS1_ONLY case, but sufficient for boot2(UFS1+2). Sponsored by: DARPA & NAI Labs Notes: svn path=/head/; revision=104618
* Ups, forgot to tell cvs commit about this file.Poul-Henning Kamp2002-10-071-0/+1
| | | | | | | | | Move UFS1_ONLY to Makefiles instead of common/ufsread.c Sponsored by: DARPA & NAI Labs Notes: svn path=/head/; revision=104613
* Move the definition of UFS1_ONLY into the Makefiles where it belongs.Poul-Henning Kamp2002-10-074-3/+5
| | | | | | | Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104612
* Connected boot2.Yoshihiro Takahashi2002-10-031-1/+1
| | | | Notes: svn path=/head/; revision=104413
* Added some header files from -stable and fixed the boot[12] programs.Yoshihiro Takahashi2002-10-038-7/+1077
| | | | Notes: svn path=/head/; revision=104412
* Don't call INT 12H anymore in boot program.Mitsuru IWASAKI2002-10-013-2/+6
| | | | | | | | | | | | | | Many recent machine have a broken INT 12H (Get base memory size) implementation and boot program stops if INT 12H is called. This commit should solve the problem at very first step of FreeBSD installation occurred on newer some machines. Reviewed by: bde, jhb MFC after: 1 week Notes: svn path=/head/; revision=104315
* Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:Poul-Henning Kamp2002-10-013-0/+3
| | | | | | | | | | | | | | | | | | | Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h. These two new copies are still intact copies of disklabel.h and therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them in programs which already include <sys.disklabel.h> is currently a no-op. This commit adds a number of such #includes. Once I have verified that I have fixed all the places which need fixing, I will commit the updated versions of the three #include files. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104272
* Use as's --defsym switch to compensate for the loss of the M4 substitutionPeter Wemm2002-09-303-4/+2
| | | | | | | | | of SIOPRT which broke kgzldr and therefore make release. Pointed out by: murray Notes: svn path=/head/; revision=104234
* Fixed to build after removing a.out suppot.Yoshihiro Takahashi2002-09-241-6/+6
| | | | Notes: svn path=/head/; revision=103877
* use __packed.Alfred Perlstein2002-09-234-27/+27
| | | | Notes: svn path=/head/; revision=103870