summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
Commit message (Collapse)AuthorAgeFilesLines
* Fix misallocation of buffer bug (too short)archie1998-11-201-1/+1
|
* This fixes a bug in the bcache code whereby false cache hits occurpaul1998-11-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the first time block 0 is read. This fix initialises the block numbers to -1 which isn't the most correct thing for a daddr_t but it isn't likely to cause a problem in the boot blocks and it could do with a more thought out fix later. The bug is probably benign on the i386 but on the alpha it can cause initial file opens to fail. This is the cause of the "can't open /boot/boot.conf" errors. It appears on the alpha because of a number of combining factors. On the alpha the LABELSECTOR is 0 so block 0 needs to be read in from the media. The first time this happens you get a false hit because the bc_blkno field is zero initially. Also, the timestamp check against this cache hit succeeds because on the alpha a hacked getsecs() function can return 0 when it starts counting so that the zero initial timestamp + BCACHE_TIMEOUT is greater than the current time until getsecs() has counted passed BCACHE_TIMEOUT. The overall effect is that the first open() that occurs gets a false cache hit and returns garbage to the bd_strategy() function which then fails the open() call. This false hit then stays in the cache until BCACHE_TIMEOUT getsecs() ticks have passed; all open() calls during this time fail. This explains why you can generally access the media by the time you get to interp() and start issuing commands but the earlier attempts to run the boot scripts are failing. It's possible that this is causing the problem switching to the mfsroot floppy as well but I haven't confirmed that.
* Add documentation for $rootdev.msmith1998-11-131-1/+10
|
* Eliminate much code cruft by extending simple file I/O API to includejkh1998-11-071-4/+9
| | | | | fopen and fclose. Also look for /boot/boot.4th now and, if found, load its contents.
* Don't have debugging on by default - it makes testing annoying. :)jkh1998-11-071-2/+2
|
* Ack. Create parseable command tail properly, and eat args out of the TIB.msmith1998-11-061-2/+5
|
* Don't use the poxy vmGetString interface (who uses counted strings thesemsmith1998-11-061-7/+23
| | | | days?), get the input buffer ourselves. Add some debugging code.
* Remember a bit more of my forth and do:jkh1998-11-051-3/+4
| | | | | | | | | o Add fexists word to check for the presence of a file o make fexists and fload immediate words which DTRT both interpreted and compiled (doh!) o add an init word which gets run at bootstrapping time to do extra post-coldload initialization (in the default implementation, we look for /boot/boot.4th and load it if found).
* Use a smaller default dictionary to waste less space.msmith1998-11-041-2/+2
|
* Add BootForth hooks; if BOOT_FORTH is defined, pass every line readmsmith1998-11-044-5/+155
| | | | | | | to the Forth interpreter. Instantiate all of our inbuilt commands as Forth words, and handle them being called from there. Add my copyright to the bcache module (oops).
* Ok, the entry aging algorithm sucked; 1s time resolution is not enough formsmith1998-11-021-7/+16
| | | | | LRU. Use a 31-bit counter instead. If we decide to do heavy I/O through the bootloader this will have to be revisited.
* Implement a simple LRU block cache. By default this is initialised to 16k,msmith1998-11-023-4/+241
| | | | | | | | | | | | | | and will bypass transfers for more than 8k. Blocks are invalidated after 2 seconds, so removable media should not confuse the cache. The 8k threshold is a compromise; all UFS transfers performed by libstand are 8k or less, so large file reads thrash the cache. However many filesystem metadata operations are also performed using 8k blocks, so using a lower threshold gives poor performance. Those of you with an eye for cache algorithms are welcome to tell me how badly this one sucks; you can start with the 'bcachestats' command which will print the contents of the cache and access statistics.
* Standardise on ';' as a component separator; it seems to be a little moremsmith1998-11-021-4/+4
| | | | common than ','.
* * Extend the memory available for the heap from 256k to 512k.dfr1998-10-311-2/+2
| | | | | | | | | * Embed the stack into the bss section for loader and netboot. This is required for netboot since otherwise the stack would be inside our heap. * Install loader and netboot in /boot by default. * Fix getbootfile so that it searches for a ',' instead of a ';' when terminating the filename.
* - Add a new command 'lsdev' to list devices which might be likely to hostmsmith1998-10-315-14/+605
| | | | | | | | | | filesystems. - New 'help' command and data in the help.* files (not yet installed), provides topic and subtopic help, indexes, etc. - Don't crash if the user tries to set an invalid console. Be helpful instead. - Expand tabs (badly) on the i386 video console. - Some minor cosmetic changes.
* Export an interface for presetting the ISA PnP read port address.msmith1998-10-223-46/+77
| | | | Make the EISA ID formatter generally available
* Make ISA PnP work. This successfully enumerates as many ISA devices as Imsmith1998-10-216-127/+303
| | | | | | | | | | | | can fit into my test machine. - Move to using STAILQs rather than ad-hoc singly-linked lists. - Use a mostly procedural interface to the PnP information. This improves data-hiding. Implement a new linker-set technique (currently on i386 only but should work on Alpha as well). This is a good candidate for replacing the current gensetdefs cruft completely.
* Load the first page of the file and use the headers in it. This shouldpeter1998-10-171-52/+48
| | | | | avoid the need to seek back to offset zero which is causing trouble on the Alpha with a gzipped kernel.
* "fix" the gzipped kernel load problem by having the loader check that itpeter1998-10-161-22/+33
| | | | | | | can seek back to the first PT_LOAD and doing a close/reopen if it cannot. This is because the first PT_LOAD section includes the ELF headers. This fixes gzipped kernels on the i386, it should solve mike's problem for the Alpha.
* Change some printfs so that ELF_VERBOSE prints meaningful values on the alpha.dfr1998-10-151-3/+3
|
* Tweak the output one more time again. The kernel or module pathnamepeter1998-10-142-5/+6
| | | | is useful, and usually fits all on one line with the load sizes.
* Make the ELF load messages cleaner.peter1998-10-131-8/+17
|
* Only print kernel entry point during load.peter1998-10-121-62/+76
| | | | | | | | | | | | | | | | | | | Drastically quieten down the verbose load progress messages. They were more useful for debugging than anything, but are beyond a joke when loading a few dozen modules. Simplify the ELF extended symbol table load format. Just take the main symbol table and the string table that corresponds. This is what we will be getting local symbols from. (needed for the alpha stack tracebacks). Use the (optional) full symbol tables in lookups. This means we have to furhter distinguish between symbols that can come from the dynamic linking table and the complete table. The alpha boot code now needs to be adapted as ddb/db_elf.c cannot use the simpler format. I have not implemented loading the extended symbol tables from the syscall interface yet, just for preloaded modules. I am not sure about the symbol resolution. I *think* it's possible that a local symbol can be found in preference to a global, depending on the search sequence and dependency tree.
* Only print filename and entry address for the kernel itself. The restpeter1998-10-121-2/+3
| | | | have a meaningless entry as they are relocatable.
* Fix a warningpeter1998-10-111-2/+2
|
* Probe all consoles, not just the first. It doesn't make a lot ofpeter1998-10-111-7/+21
| | | | | | | | | | difference, but might later on when we implement some sort of multi-head console mode. Select a console after probing them all. Don't strdup a potentially NULL return from getenv(). If we don't select an active console, choose the first regardless. Call the console init function, at startup time and on a manual change. The env_setenv() function needs EV_VOLATILE because it's pointing to data that isn't malloc'ed and will cause a fault if it's freed later.
* Cosmetic: After the autoboot timeout, print a \n.peter1998-10-111-2/+6
|
* Implement preloading for elf modulespeter1998-10-091-33/+129
| | | | | | | | - get dependency info from PT_DYNAMIC's DT_NEEDED tags. - store MODINFOMD_DYNAMIC for the kernel's later use setenv kernelname when we have it Fix firstaddr/lastaddr calculation (duh! :-) Explicitly skip string table with section names in it.
* Preload support for a.out KLD not implemented yet. (almost)peter1998-10-091-131/+25
| | | | | | | | KLD modules are *not* PIC. (Shared libs are pic to avoid relocations causing copy-on-write, that's irrelevant here). setenv kernelname when we load it. Use MODINFO_SSYM/ESYM for each symbol section when (if) there are more than one being loaded.
* Use a consistant module search path (same as kernel will be).peter1998-10-091-26/+17
| | | | Use new dependency mechanism.
* loader <-> kernel preload module interface constants moved to common file.peter1998-10-091-53/+1
| | | | | | Remove Mike's explicit data structures for dependency info. This is done via DT_NEEDED etc in the dynamic section for now. This may need to be revisited later on.
* Sync the MODINFO constants with <sys/linker.h>msmith1998-10-094-41/+90
| | | | | | Remove debugging in command_read(). Correctly strip leading controls on script commands. Make 'ls' more DWIM in regard to pathnames. We can still do better.
* - VERBOSE_LS is obsolete, as the heap is much better behaved now.msmith1998-10-075-54/+197
| | | | | | | | | | | | | | | - Don't whine about nodes we can't stat(); these are usually symlinks that lead out of the filesystem. - Autoboot is now controlled by $autoboot_delay, which is a value in seconds or NO to disable autoboot. - Don't autoboot at the end of boot.conf if we have already tried. - Add a 'read' command to complement 'echo'. Both are still hidden. - Improve the 'source' command/function so that it is possible to source scripts off removable media. The entire script is read and saved before beginning execution. Script lines beginning with '@' will not be echoed when being executed. Script execution will normally terminate at the first error, however if the script line begins with '-' this behaviour is overriden for that command.
* Insert whitespace between unargv'd arguments.msmith1998-10-051-3/+7
| | | | Submitted by: "Louis A. Mamakos" <louie@TransSys.COM>
* boot.cmsmith1998-10-022-6/+12
| | | | | | | | | | | Increase the robustness of the "is it time to boot yet" test; if the time skipped the "when" time, we would miss it. Don't spin in an endless loop if we don't find the first possible kernel suggested. When we run out, don't try to load an empty kernel name. load_aout.c printf format warnings
* First shot at loading elf symbols. Things are a bit strange becausepeter1998-10-022-14/+129
| | | | | | | | | | | | of the ..umm.. "wierd" way binutils lays out the file. The section headers are nearly at the end of the file and this is a problem when loading from a .gz file which can't seek backwards (or has a limited reverse seek, ~2K from memory). This is intended to be compatable with the ddb/db_elf.c code and the alpha/libalpha/elf_freebsd.c layout. I've studied these (which are NetBSD derived) but did it a bit differently. Naturally the process is similar since it's supposed to end up with the same result.
* ELF loader, part 1. It works with ELF kernels generated on the i386peter1998-09-302-2/+278
| | | | | | | | | | | | | | | | | | | so far, and should probably be able to be made to work for the alpha without too much trouble once it's connected up and my assumptions tested. I think (but have not tested) it will also load "old" ELF kernels that were not linked with DYNAMIC headers. The module glue is yet to come. (oh fun.. :-) It does not explicitly load symbols [yet]. The _DYNAMIC data contains a runtime symbol set that ddb can use via ddb/db_kld.c. It'll be missing some detail that stabs normally provides (eg: number of args to a function, line numbers, etc). On the other hand, those minimal symbols will always be available even on a stripped kernel. This is mostly stolen from load_aout.c with some ideas from alpha/libalpha/elf_freebsd.c.
* s/out_loadmodule/aout_loadmodule/ in a printf diagnostic.peter1998-09-301-2/+2
|
* Uncomment prototype for elf_loadmodulepeter1998-09-301-2/+2
|
* Use the variable with the path in it for the error message.peter1998-09-281-2/+2
|
* * Add old UFS compatibility code to alpha/boot1.dfr1998-09-265-17/+18
| | | | | | * Fix a raft of warnings, printf and otherwise. * Allocate the correct amount in mod_searchmodule to prevent an overflow. * Fix the makefiles so they work outside my home directory (oops).
* console.cmsmith1998-09-265-25/+51
| | | | | | | | | | | | | | | | | | | Allow the MI code to override the preferred console (eg. so that an RB_SERIAL flag from the i386 boot2 can override the default first active console) isapnp.c Use the standard format for ISA PnP IDs. pnp.c Allow trailing comments on lines, be less picky about line contents. ls.c Cosmetic error message fix. panic.c Print the right arguments.
* Make the alpha bootstrap build again, fix some warning and change sdboot to ↵dfr1998-09-202-3/+3
| | | | daboot.
* Add a generic hexdump tool for debugging purposes.msmith1998-09-192-2/+43
|
* Remove 'panic' command (it works), don't ask for a keypress in panic, asmsmith1998-09-182-15/+2
| | | | exit() does. Perhaps it shouldn't?
* Use a.out.h to get all the correct bits in one place.msmith1998-09-181-3/+2
|
* Oops, missed these. Machine-independant ISA PnP enumerator.msmith1998-09-182-0/+573
|
* Initial integration of the i386 bootloader and BTX.msmith1998-09-174-5/+326
| | | | | | | | | | | - Discard large amounts of BIOS-related code in favour of the more compact BTX vm86 interface. - Build the loader module as ELF, although the resulting object is a.out, make gensetdefs 32/64-bit sensitive and use a single copy of it. - Throw away installboot, as it's no longer required. - Use direct bcopy operations in the i386_copy module, as BTX maps the first 16M of memory. Check operations against the detected size of actual memory.
* Resynch with working sources before BTX integration.msmith1998-09-146-106/+248
| | | | | | | | | | | - Use format-independant module allocator. - Conditionalise ISA PnP support. - Simplify PnP enumerator interface. - Improve module/object searching. - Add missing depend/install targets in BTX makefiles. - Pass the kernel environment and module data in extended bootinfo fields. - Add a pointer to the end of the kernel + modules in bootinfo. - Fix parsing of old-style kernel arguments.
* Generic plug-and-play enumerator infrastructure. Query suppliedmsmith1998-09-044-5/+249
| | | | | enumerators, crossreference returned identifiers with a text-format database and automatically load corresponding modules and dependancies.
OpenPOWER on IntegriCloud