Commit Graph

334 Commits

Author SHA1 Message Date
Philippe Houdoin
ac9005b4bb s/OpenBeOS/Haiku/
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-20 15:47:22 +00:00
Axel Dörfler
d31902e857 The new logo for the boot loader.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-20 00:49:23 +00:00
Axel Dörfler
5b82deb912 Now checks for boot options; if you press space, it will enter the boot menu
(when there is one), if you press escape, it will boot in console mode.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 15:32:49 +00:00
Axel Dörfler
c89be553a6 Added keyboard.cpp to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8051 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 15:30:39 +00:00
Axel Dörfler
d0c5d9f9a8 Removed some debug output, no longer panics to be able to read the output :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 15:29:31 +00:00
Axel Dörfler
c28f7b9932 Removed platform_user_menu_requested() call.
Replaced its functionality by a new platform_boot_options() call.
The switch to the logo screen now comes a little later.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8049 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 15:26:53 +00:00
Axel Dörfler
2ac69a4d66 Activated CPU speed conversion factor calculation again.
Added a spin() function.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 15:23:18 +00:00
Axel Dörfler
baf3145769 Fixed a big bug in the ELF loader: it didn't clear out the loaded segment
above p_filesz - that means it didn't clear BSS etc. - this was not noticeable
from Bochs, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8045 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 15:20:47 +00:00
Axel Dörfler
4c179368aa vesa_get_mode_info() no longer copies the buffer as well; it will now
write the contents directly into the buffer. If we'll ever intend to
store mode infos in kernel memory, this should be changed back.
vesa_set_mode() now sets the correct flags to get a linear frame buffer;
graphical boot now works in Bochs 2.1.1 as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 13:47:00 +00:00
Axel Dörfler
e70d4cb70e Added some VBE set mode definitions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 13:41:38 +00:00
Axel Dörfler
ce5cf7b312 Simplified the VBE info block retrieval: we now use the intended target
address directly, and therefore, we don't have to copy the structure
and eventually relocate the pointers.
Made the boot logo location dependent on its size.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8042 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 13:29:32 +00:00
Axel Dörfler
7fe1bdeec9 Added some handy address conversion macros.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8041 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 13:23:34 +00:00
Axel Dörfler
fc17fe17eb Implemented the BIOS functions to access the keyboard buffer.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-18 02:48:53 +00:00
Axel Dörfler
3ae898da8b Fixed the PPC boot loader build and added empty stub routines.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8022 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-17 12:22:10 +00:00
Axel Dörfler
c8079ef9c9 Now switched to the boot logo and back when necessary.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8017 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-17 01:03:36 +00:00
Axel Dörfler
eefe4b1d21 Work in progress:
- began to integrate the SMP/CPU stuff from the old boot loader; currently
  disabled, though
- began VESA/VGA support
- added temporary boot splash screen; it's a bit of a hack and only seem
  to work in Bochs 2.0.2 for now... (but hey, it looks good ;-))


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8016 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-17 01:02:40 +00:00
Axel Dörfler
754fdef3d7 panic() now calls hlt instead of spinning forever.
Added a ToDo comment.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-17 00:59:02 +00:00
Axel Dörfler
842a265376 mmu_map_physical_memory() now accepts physical memory addresses that are not aligned to a page.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-17 00:56:45 +00:00
Axel Dörfler
1273cbedfc Added new function to map physical memory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-17 00:53:00 +00:00
Axel Dörfler
faad86a4aa Some more debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-17 00:49:34 +00:00
Axel Dörfler
0e3f14ee1d Now return useful inode numbers. The BFS inode numbers match the ones from
the real kernel file system (as there is no amiga_ffs add-on yet).
The file systems now also return the module name of their kernel counterparts.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7995 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 17:05:34 +00:00
Axel Dörfler
50ef9ecfb6 Now stores the module name of the modules handling the partition.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 17:04:05 +00:00
Axel Dörfler
082a2195f0 fstat() now fills in the inode number as well.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 17:01:45 +00:00
Axel Dörfler
a1b4720e1a load_modules() will now also load all modules that are needed to identify
the partitioning and file system of the boot volume.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 17:00:52 +00:00
Axel Dörfler
d88c45c6f2 Now maintains the inode field in the preloaded_image structure.
It will now load all modules only once by identifying them using their inode number.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 16:59:59 +00:00
Axel Dörfler
4807cd86ea Now stores a link to the partition of a volume, and adds a new method
GetPartitionFor() to retrieve that information again.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 16:58:50 +00:00
Axel Dörfler
201b3e6fd1 Now maintains the kernel_args size and version fields.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7988 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 16:55:45 +00:00
Axel Dörfler
0e67fb5a42 Now maintains the kernel_args size and version fields.
Removed unused code.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 16:55:27 +00:00
Axel Dörfler
995a393e12 Unfortunately, -fno-pic must be set manually, even for kernel rules.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 16:49:36 +00:00
Axel Dörfler
8b33111039 Updated ELF loader to use preloaded_image struct for the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7712 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-31 23:52:01 +00:00
Axel Dörfler
b1b1136ca3 No longer uses gKernelEntry.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7710 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-31 23:15:37 +00:00
Axel Dörfler
2f42f1cf3a gKernelEntry is no longer needed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-31 23:12:15 +00:00
Axel Dörfler
cbb2b6c19f The kernel image data is now maintained in a preloaded_image as well.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7707 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-31 22:54:43 +00:00
Axel Dörfler
fa1ddc4f0e For debugging purposes, the boot loader is now able to load an additional
symbol table into memory and hand it over to the kernel.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7695 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-31 20:30:20 +00:00
Axel Dörfler
88cfa4fb99 Applied Jack Burton's patch to fix the boot problems on many systems:
find_real_mem_size must not be called with interrupts turned off.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-18 10:27:28 +00:00
Axel Dörfler
dc4eb9db8d Removed unneeded code, updated comment.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7519 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-11 14:20:14 +00:00
Axel Dörfler
ff76eb5cde Boot loader BFS now has symbolic link support.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7516 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-11 12:16:26 +00:00
Axel Dörfler
73b10c8f1e Adapted the fstat/_fstat work-around to like the user boot loader build as well.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7514 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-11 01:07:54 +00:00
Axel Dörfler
259fd3cdfb open_from() now also supports absolute paths, in which case it will ignore
the passed in directory.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7513 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-11 00:26:22 +00:00
Axel Dörfler
429fb127d3 Fixes the build until we have this _fstat()/fstat() thing worked out.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7512 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 23:04:52 +00:00
Axel Dörfler
d15df01c72 load_modules() now actually load modules; it doesn't just print out their name any longer.
Now scans "/boot/home/config/add-ons/kernel/boot" as well as "/boot/beos/system/add-ons/kernel/boot".


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 19:00:05 +00:00
Axel Dörfler
38f5c6bbc4 Corrected elf_load_image() prototype; it requires an object of the Directory
class as first argument.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7505 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 18:57:58 +00:00
Axel Dörfler
cdacbf022a elf_load_image() always returned B_OK instead of the real status.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7504 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 18:57:12 +00:00
Axel Dörfler
bf67cc9591 Now uses the correct heap to allocate the image path name (kernel_args).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 16:49:23 +00:00
Axel Dörfler
e883af3cda Since we use the same includes as the real system, we now export _fstat()
with 3 arguments instead of fstat().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7501 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 16:48:33 +00:00
Axel Dörfler
007c81ec98 Added kernel_args_strdup() function as a strdup() replacement.
Added a ToDo comment.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 16:47:06 +00:00
Axel Dörfler
dc8585a402 Worked around a strange bug that happened without an additional printf in between...
Somehow that reminds of BASIC.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7420 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-06 00:39:01 +00:00
Axel Dörfler
511252a157 AddLink() added the link to the list of mounted volumes instead of the list
of links - that could have possibly hidden the boot volume under certain
circumstances. Thanks to Sean O'Brien for pointing this out.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7343 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-28 23:57:47 +00:00
Axel Dörfler
3a4a20a09e Updated to match general boot loader changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-22 01:13:20 +00:00
Axel Dörfler
3004a40b85 address_range is now called addr_range (again, to let the structure and the
typedef name match).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7293 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-22 01:06:01 +00:00
Axel Dörfler
bbf495f47d map_page() will now be a bit more specific when it complains about an
invalid page.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 18:45:21 +00:00
Axel Dörfler
8d35b1a200 platform_start_kernel() now prints out the kernel entry point instead of
the address of the kernel_args structure.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 11:11:45 +00:00
Axel Dörfler
4eedc697c3 platform_get_boot_partition() will now also get the boot device as parameter.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7284 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 11:10:32 +00:00
Axel Dörfler
4c03f90f63 Now correctly translates the partition block offset into a byte offset.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7283 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 11:09:33 +00:00
Axel Dörfler
fbe5e77d0b Added a simple second heap that will survive the switch to the kernel.
elf_load_image() now uses this heap for the preloaded_image structures.
Moved gKernelArgs and gKernelEntry to different files.
Improved enabling debug output (it can now be activated by a makefile, too)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7281 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 02:32:36 +00:00
Axel Dörfler
d8023a2fc5 Fills in the required kernel args for the loaded kernel image.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7280 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 01:34:47 +00:00
Axel Dörfler
6ef64f7451 elf_load_image() now also saves the size of the dynamic section.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7279 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 01:33:44 +00:00
Axel Dörfler
822757438d No longer uses the local ka at 0x100000 but the global gKernelArgs structure.
The virtual/physical allocated ranges are now correctly filled in mmu_init_for_kernel(),
and no longer too early.
Now allocates a kernel stack of 8192 bytes.
Added some temporary fillers for the kernel args.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7270 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-21 00:04:37 +00:00
Axel Dörfler
ffcff6e28c Added platform_start_kernel() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 23:52:17 +00:00
Axel Dörfler
50f3983035 Added gKernelEntry variable; it's now set in load_kernel().
Removed start_kernel() function - it's now replaced by the platform_start_kernel()
call.
Fixed the kernel add-on boot module search path.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 23:45:32 +00:00
Axel Dörfler
730036e22e Improved debug output.
start_kernel() now panics, so that we don't run through (since it doesn't
actually jump to the kernel yet).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 01:36:12 +00:00
Axel Dörfler
f7fced6cf5 Slightly improved debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7255 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 01:34:21 +00:00
Axel Dörfler
276c009500 Moved the platform region and heap functions to mmu.cpp.
The heap will now no longer be mapped in kernel space, but will be placed
at a fixed address (0x110000 - former start of free physical memory).
platform_allocate_region() is now implemented and calls mmu_allocate().
mmu_allocate() now supports mapping to a predefined virtual address
to be able to load the kernel correctly (and only for that).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 01:31:20 +00:00
Axel Dörfler
0f87a64b54 Add support for the boot partition offset as provided by the BFS boot block.
Now, platform_get_boot_partition() will work correctly.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7253 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 01:26:56 +00:00
Axel Dörfler
cdc8d6b6f5 The source files may now include the boot/partitions.h header.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7252 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 01:21:42 +00:00
Axel Dörfler
c8baeaf6cf Added support for the boot partition offset as provided by the BFS boot block.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7251 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-20 01:20:43 +00:00
Axel Dörfler
9fd7586724 gBootDriveID is now uint8, no longer uint16.
Now prints out a comment if LBA access doesn't work (since CHS access is not yet implemented).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 23:33:23 +00:00
Axel Dörfler
f52302c408 Actually, one byte is enough for gBIOSDriveID - it only has to store %dl, not %dx.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7249 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 23:31:53 +00:00
Axel Dörfler
502a70f884 Implemented LBA drive access using the BIOS. The boot device is correctly
published, and can be accessed as needed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7248 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 23:14:05 +00:00
Axel Dörfler
7ca2763dc3 Now uses the kExtraSegmentScratch constant rather than a direct address.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 22:43:04 +00:00
Axel Dörfler
cc551468f8 Added some constants that define scratch buffers in the data and extra
segment that can be used for BIOS calls.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7246 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 22:38:30 +00:00
Axel Dörfler
6ed14d8c59 Added a global variable gBootDriveID where %dl is stored to.
Moved the data section closer to the end of the 1024 bytes of the boot
block - the region before is reused as scratch buffer in the real mode
data segment.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7245 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 22:36:13 +00:00
Axel Dörfler
c2cb9079b5 Fixed a warning with debug turned on.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 21:58:43 +00:00
Axel Dörfler
acfef65c84 Fixed a bug that would rescan the boot partition in mount_file_systems() in
case it couldn't be used for booting (lack of a kernel or whatever).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 21:57:50 +00:00
Axel Dörfler
3796dbef26 Added the new files to the build, and implemented a real startup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 01:57:29 +00:00
Axel Dörfler
b2f8da6214 Added prototype for the (currently unused) mmu_init_for_kernel() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 01:56:36 +00:00
Axel Dörfler
95aa3fbf11 MMU functions and initialization for the boot loader.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 01:50:26 +00:00
Axel Dörfler
487cc516ec Register %es was not properly set from the bios_regs structure
(since switch_to_real_mode() overwrites %es).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7237 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 01:31:19 +00:00
Axel Dörfler
65daec27d1 Added a definition for the carry flag.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7236 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 01:30:13 +00:00
Axel Dörfler
d2e0469de4 Verified A20 gate BIOS call values with Ralf Brown's interrupt list - 0x2401/2
was already correct, and my other source was wrong about it.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7234 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-19 00:00:53 +00:00
Axel Dörfler
46df41d103 Implemented call_bios() function that is called from protected mode.
It switches to real mode for execution of the BIOS interrupt; it's really
only intended for the boot loader.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7233 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-18 23:58:26 +00:00
Axel Dörfler
1e56fb4aeb The "ax" code I was using for the A20 gate stuff was obviously wrong; but
both Bochs and my real computer seem to know it anyway, so it's untested.
The real mode segment descriptors now start at 0x10000, because the code
is loaded there. Added an additional stack segment descriptor to be able
to use a stack below 0x10000.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7232 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-18 22:07:41 +00:00
Axel Dörfler
7ab45fdea5 Removed unused welcome message print code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7198 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-13 16:54:42 +00:00
Axel Dörfler
b911d01e3d Started the "shell" of the 2nd stage boot loader: it will enable the A20
gate, switch to protected mode, and will then jump to the platform dependent
loader initialization.
This is the start of the zbeos equivalent. It can already be executed
using the BFS boot block, but it cannot yet load itself from a floppy
like the original does.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7197 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-13 16:43:12 +00:00
Axel Dörfler
cdae4b7cf1 Added panic()/dprintf() calls to the x86 bootloader bindings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7057 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-23 01:03:24 +00:00
Axel Dörfler
06c0f437a7 Added "\n" -> "\r\n" translation for console output, not yet tested.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-19 18:32:37 +00:00
Axel Dörfler
498a8e8be0 Now uses vsnprintf() instead of vsprintf() which makes the output safe.
Removed "\n" -> "\r\n" translation (it's now done in the platform dependent part).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7030 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-19 18:30:31 +00:00
Axel Dörfler
788d2b04ea Implemented console output for x86 boot loader.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7029 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-19 18:28:26 +00:00
Axel Dörfler
3bba0ebe0a NewOS revisited, applied patch 1916: now evaluates the extended BIOS
RAM size call.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-15 00:58:49 +00:00
Axel Dörfler
4a2e872cca Applied NewOS change 1914: moved APIC setup into the kernel due to a
problem with the APIC clock speed test.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6980 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-14 22:54:00 +00:00
Axel Dörfler
81e08ae466 kernel_cpp.cpp needs direct access to headers/private/kernel/util in order
to not include our current stdio.h.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-02-15 18:08:15 +00:00
Axel Dörfler
558d32f86a Thanks to Ingo's change in KernelMergeObject, the arch-specific part of
the OpenFirmware platform is now linked in directly.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5246 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-11-03 13:56:13 +00:00
Axel Dörfler
c3efd542cd Now accepts only "block" devices as boot device (we do not support
network booting (for R1), and if we will, it will be done using another
mechanism anyway).
If it runs under Apple's OF implementation, it now adds ":0" as parameter
to the opened block device to bypass the disk-label package - that part
is obviously implementation specific (and took me some time to figure
out, even if it's just two characters ;-).
Added a commented block of code that could be used in combination with
MOL and it's (in the meantime fixed) broken device access via OF.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-28 21:29:59 +00:00
Axel Dörfler
d3b44eeac9 Added definition of a of_arguments structure which is used in all
OpenFirmware client service calls (and callbacks).
Has nice inline argument getter methods If compiled under C++.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5205 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-28 21:26:08 +00:00
Axel Dörfler
c9593d2253 Now uses the OF root node properties "model" and "device_type" to get
and idea about the underlying hardware (needed at other places).
Calls arch_set_callback() right after MMU takeover.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5204 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-28 21:24:28 +00:00
Axel Dörfler
6bf336d531 Implemented the OpenFirmware MMU callback hook mechanism.
Added empty callbacks for "alloc-real-mem" and "unmap".
Implemented "map" and "translate" - the latter is not yet tested, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-28 21:22:21 +00:00
Axel Dörfler
41fc24055a Added more debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5183 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-28 02:23:30 +00:00
Axel Dörfler
553e5a0f6f BFS/AmigaFFS directory Open()/Close() methods now correctly call the
respective methods of their parent (one possible crash less, as the
nodes could get deleted accidently).
The AmigaFFS is now silent if it just don't know the signature.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-28 02:13:12 +00:00
Axel Dörfler
c5b5378a79 The recently added load_kernel() tried to load the kernel again (there already
was a load_kernel() call above). Added a comment that might prevent me from
doing that again...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 05:39:36 +00:00
Axel Dörfler
a721098497 Now prints an error message if the kernel couldn't be loaded.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5111 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 05:35:57 +00:00
Axel Dörfler
4f364c85af Enabled and added some more debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5110 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 05:35:32 +00:00
Axel Dörfler
a47544320d Fixed File::ReadAt() (it didn't return the actual length read, just B_OK).
Visually simplified Volume::ToBlock().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5109 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 05:27:24 +00:00
Axel Dörfler
caac43e662 Fixed missing initialization of fBlock in one of the constructors of CachedBlock.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5107 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 04:25:20 +00:00
Axel Dörfler
bc0096be96 Compiles again.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5105 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 04:16:06 +00:00
Axel Dörfler
d69f033efd Fixed a warning.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5104 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 04:08:04 +00:00
Axel Dörfler
1aa6a4ca46 Added link handling to the RootFileSystem (for the "boot" link).
Renamed AddNode() to AddVolume() - it's no longer virtual but private to
the root file system.
Added new method AddLink() to add a link to a volume.
The link handling is separate from the other volumes (to be able to iterate
only over real volumes). Added a name field to the inner entry class which
is used for links.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 04:05:34 +00:00
Axel Dörfler
9bf99ee93b Now registers the boot device and loads the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 04:01:09 +00:00
Axel Dörfler
18562ebdd8 gRoot is now defined in RootFileSystem.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5101 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 04:00:12 +00:00
Axel Dörfler
77cfe0902a gRoot is now defined in RootFileSystem.h, AddNode() is now called AddVolume().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 03:59:39 +00:00
Axel Dörfler
6822f1482e gRoot is now a RootFileSystem, not just a Directory anymore.
register_boot_file_system() adds the "boot" link to the root fs.
mount_all_file_systems() now prints out the root directory of the
mounted volumes just for fun (to be removed later).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5099 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 03:58:40 +00:00
Axel Dörfler
7fc11e15bb Some work-in-progress on the MMU functions:
- it will now successfully take over the MMU, but it doesn't tell OF
  yet about it.
- map_page() will now fill in the page table relative to sSegments[], and
  no longer to the segment registers directly (as they might be different
  at that time, depending on the OF).
- map_page() will panic if it couldn't find a free slot in the page table
  (that's enough for the boot loader)
- finds the exception handlers mapping and sets the kernel args
- rewrote insert_memory_range(); it now actually works in all cases (no
  matter if the ranges overlap or not, and it will also join ranges if
  possible). The start address will now be round down to page aligment.
- some other small fixes
- the page table is now cleared before use (as of_claim() obviously doesn't
  return cleared memory).
- replaced some uint32 with addr_t where it made sense (there are probably
  even more places).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5093 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-21 03:19:01 +00:00
Axel Dörfler
4790079584 Renamed arch_mmu_alloc_at() to arch_mmu_allocate(), removed arch_mmu_alloc().
Added new arch_mmu_free() function (not yet implemented).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5057 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:44:18 +00:00
Axel Dörfler
73ebb119f3 Forgot to check the endian of the ELF header.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5053 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:08:04 +00:00
Axel Dörfler
f44f6a045e Removed test MMU allocation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:07:21 +00:00
Axel Dörfler
2ea8f7d444 Added mmu.cpp to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5051 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:06:25 +00:00
Axel Dörfler
b6384820ac Implemented the platform MMU functions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:05:37 +00:00
Axel Dörfler
384be72972 Implemented load_kernel(), load_modules() now traverses the
/boot/beos/system/add-ons/boot directory for boot modules (it
currently only prints out all the modules found).
Not yet tested!


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5049 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:02:36 +00:00
Axel Dörfler
21a3fff594 Added the ELF loader to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5048 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:01:24 +00:00
Axel Dörfler
8fbf1c6169 Since there currently are no directory traversing functions, I've
added a temporary get_node_from() function which returns the Node
assigned to the file descriptor.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5047 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 18:00:28 +00:00
Axel Dörfler
af0e9e9d12 Implemented the boot loader's ELF loader (untested).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-16 17:58:55 +00:00
Axel Dörfler
962c1957d8 Minor fixes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5020 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-14 00:34:08 +00:00
Axel Dörfler
2664bace2e Changed to use the DoublyLinked::List implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5019 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-14 00:33:11 +00:00
Axel Dörfler
603d81b967 Some more debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-14 00:31:12 +00:00
Axel Dörfler
53bc5ce937 Switched to use the DoublyLinked::List implemenatition.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5017 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-14 00:29:47 +00:00
Axel Dörfler
2d6751a062 Switched to the new DoublyLinkedList implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-13 03:38:05 +00:00
Axel Dörfler
f981a55840 Fixed GCC 3 warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-12 00:47:28 +00:00
Axel Dörfler
748d45313d Two more #include <util/kernel_cpp.h> for consistency's sake.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-12 00:45:38 +00:00
Axel Dörfler
df46e9e59f OpenFirmware now has its own arch subtree. Added most of the code needed
to take over the PPC MMU (and let OF still operate) - there is basically
everything to implement a proper ELF loader now.
Unlike BIOS/IA-32, OpenFirmware is available on a lot of architectures.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-11 19:06:28 +00:00
Axel Dörfler
10fc9d123f Updated renamed kernel_args fields.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 23:50:15 +00:00
Axel Dörfler
9e88f0cfd2 Now declares the gKernelArgs variable to pass to the kernel.
Calls heap_release() with stage2_args.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 22:49:49 +00:00
Axel Dörfler
a4fab93eee heap_release() now gets the stage2_args as well, to pass them to
platform_release_heap().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 22:48:46 +00:00
Axel Dörfler
d1ae059dec Now sets the heap_size field of stage2_args to a default value.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 22:47:00 +00:00
Axel Dörfler
02ec644ad8 Removed declaration and initialization of gChosen; it's not done in openfirmware.c.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4964 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 22:45:38 +00:00
Axel Dörfler
67e8a1390b Added an "align" parameter to of_claim().
Added prototype for of_call_method().
gChosen is now declared and initialized in this file, therefore, of_init()
can now fail (in case gChosen cannot be set).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4963 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 22:44:34 +00:00
Axel Dörfler
bc09bddb53 The heap size is now part of the stage2_args.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4962 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 22:41:44 +00:00
Axel Dörfler
8fb9411174 Added support for the Amiga FFS to the standard bootloader build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-02 01:17:37 +00:00
Axel Dörfler
291a681b35 Forgot to include <util/kernel_cpp.h>.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-02 01:16:57 +00:00
Axel Dörfler
1e038a1ca5 Added a ToDo comment so that I won't forget to check if there is only one
bootable device if the platform didn't provide a boot device.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4908 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 02:29:34 +00:00
Axel Dörfler
44df371a46 Updated to match the new boot loader platform API (boot() was renamed to main()).
platform_user_menu_requested() always returns "false" for now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:29:42 +00:00
Axel Dörfler
d76300d0d8 Now has (initial) support to select a boot device if the OpenFirmware
provided one - will always select the first partition on that device,
though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:28:34 +00:00
Axel Dörfler
621540d112 Updated the dummy implementation to match the changed platform API.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:26:54 +00:00
Axel Dörfler
d178a0d7e4 Implemented new Directory::IsEmpty() method.
Amiga-FFS Directory::Lookup() now only creates a HashIterator if needed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4887 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:25:06 +00:00
Axel Dörfler
3c3cc60956 Now has support to load the kernel from the boot device, and to open the
user menu if requested (even if there is none yet). It will also mount
all file systems before the user menu is shown in order to get the right
boot volume - it should probably only call user_menu() if there is more
than one possible boot device.
Removed unused parts that won't be needed anymore.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:23:25 +00:00
Axel Dörfler
6072286af6 Dunno why, but CVS didn't pick that up (see CVS comment in loader.h).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:20:21 +00:00
Axel Dörfler
c948f27797 New BOOT_ARCH definition - this is used to create the kernel name (for
looking it up on the disks); it's set to OBOS_ARCH.
Added the new files menu.cpp and loader.cpp to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:19:16 +00:00
Axel Dörfler
7c198b5d2b Made gDescriptors static, and renamed it to sDescriptors (it's private).
vfs_init() now correctly initializes the gPartitions list, and also creates
the root file system (mount_boot_file_systems() did this before). It now
no longer scans the platform for boot devices.
New function get_boot_file_system() which returns the boot file system as
chosen by the platform code.
mount_file_systems() (former mount_boot_file_systems()) now supports the
boot device; it will not scan all partitions again, but only those different
from the boot file system (if any).
get_node_for_path() did not Acquire() the start directory, but released it
(and its callers didn't acquire it, too).
Removed the commented mount() function, since it won't be needed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4883 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:17:15 +00:00
Axel Dörfler
221807be72 Added a new variant of add_partitions_for() which takes a device instead
of a file descriptor as first argument.
add_partitions_for() is now able to only mount file systems if requested;
partitions with unknown contents will not be removed from the list if it
doesn't try to mount them.
Moved the file system mounting code to the new Partition::Mount() method.
Partition::Scan() now only mounts file systems if requested.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:10:56 +00:00
Axel Dörfler
8df661e6f8 Some new "barebones" for enhanced boot loader functions for the user menu
and the kernel/module loading.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:06:52 +00:00
Axel Dörfler
1f0aeec0f0 Implemented the new IsEmpty() method.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-01 01:05:27 +00:00
Axel Dörfler
c5ccd40caa It's now silent or more verbose depending on how TRACE_BFS is defined.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-17 01:06:43 +00:00