Commit Graph

1755 Commits

Author SHA1 Message Date
Axel Dörfler
ad2a2999a9 In early boot mode, open_module_list() is not able to find everything we
want it to find; therefore, we're now using get_next_loaded_module_name().
Added a temporary suffix to the FS DDM modules (disk_device/v1) - they
might get merged with the standard FS interface modules.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-25 13:53:52 +00:00
Axel Dörfler
06eec38c23 Added a table with the names of the standard interrupts on x86: they are
now printed out when an unhandled exception is taken.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-24 14:42:43 +00:00
Axel Dörfler
3ae4fa637a Now also prints the size of every stack frame, as well as the kernel and
eventual user stack regions of the thread.
The registers are no longer jumping around depending on the length of their values.
Removed some unused or doubly included headers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-24 14:02:51 +00:00
Axel Dörfler
ddccb72483 Improved the kernel debugger's "thread" command: it will now dump the current
thread if no arguments were given.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 17:09:51 +00:00
Axel Dörfler
8c3666d980 Renamed heap_init_postsem() to _post_sem(), added new heap_init_post_thread().
We now have a working periodic wall checker, enabled by USE_CHECKING_WALL.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 13:59:27 +00:00
Axel Dörfler
842b03d549 Now calls vm_free_kernel_args().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 13:53:13 +00:00
Axel Dörfler
25c4f39f68 Implemented vm_free_kernel_args() which frees all arguments from the kernel_args arguments
list (but not the structure itself).
Now calls heap_init_post_thread(), heap_init_post_sem() was called ..._postsem() before.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 13:52:42 +00:00
Axel Dörfler
4a3a8d94e5 Add a different approach to calm down page fault handling when debug output is enabled.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9443 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 02:44:07 +00:00
Axel Dörfler
89e31dce3b kernel_args_malloc() now actually maintain the kernel_args ranges correctly.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9442 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 02:40:43 +00:00
Axel Dörfler
a17b2346d0 Now makes use of sMaxVirtualAddress to calm down gcc.
arch_cpu.h no longer includes kernel.h, so we have to do this for the
ROUNDUP()/ROUNDOWN() macros.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 02:35:37 +00:00
Axel Dörfler
8a37c740eb Renamed some init2() functions to init_post_vm() to make clearer when and why
they are called.
Fixed some return types (mostly from int to status_t).
Some minor other cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9440 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 01:50:09 +00:00
Axel Dörfler
d330cc09e2 Renamed some init2() functions to init_post_vm() to make clearer when and why
they are called.
Introduced a cpu_init_post_vm() that will now call arch_init_post_vm() instead
of letting main() doing it.
Fixed some return types (mostly from int to status_t).
Some minor other cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 01:45:43 +00:00
Axel Dörfler
93048e141e The decision to put reserved regions along real ones proves problematic: fixed
three code locations that didn't handle them properly (when iterating over all
areas).
That and the fact that unmap_and_free_physical_pages() is no longer broken now
leads to the boot region being unmapped and freed properly as intended before.
That revealed another bug: the boot loader region was disposed too early, we
need a few other components pick up boot loader resources first; it now happens
in vm_init_post_sem().
allocate_kernel_args() was also broken, and actually didn't try to allocate
kernel args areas, but tried to reallocate all the virtual allocated ranges
of the boot loader...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-21 01:38:37 +00:00
Axel Dörfler
3433f318e0 Disabled the USE_WALL checking by default.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-20 10:53:03 +00:00
Axel Dörfler
3cbdc52595 Replaced PAGE_SIZE with B_PAGE_SIZE.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-20 00:28:48 +00:00
Axel Dörfler
4d41be9656 Replaced addr with addr_t.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9431 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-20 00:26:49 +00:00
Axel Dörfler
7605ddddf0 Replaced all remaining PAGE_SIZE with B_PAGE_SIZE and "addr" with addr_t.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-20 00:19:38 +00:00
Axel Dörfler
64807a40c3 As Thomas and I found out in a late debugging session, the VM handled the
boot loaders passed in memory completely wrong (for example, the premapped
graphics buffer could be mapped to the same region as some thread stacks,
just because the VM did not use its knowledge about that mapping): the boot
loader regions are now reserved so that they cannot be overwritten
with other regions anymore. The kernel_args arguments are now tracked, and
areas are created for them (they are not yet freed, though). arch_vm_init_end()
must now call the new vm_free_unused_boot_loader_range() to free any remaining
parts of the memory not yet mapped in by any areas.
Renamed a lot of init functions (ie. postsem to post_sem, init2 to post_area),
also updated because of the vm_translation_map*() arch_vm_translation_map*() move.
B_ALREADY_WIRED can now only be used during kernel startup (it's a private flag).
Replaced PAGE_SIZE with B_PAGE_SIZE.
Some minor cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9429 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:51:42 +00:00
Axel Dörfler
be84cd391c Renamed vm_alloc_from_ka_struct() to vm_alloc_from_kernel_args().
Replaced PAGE_SIZE with B_PAGE_SIZE.
Changed some return types to status_t.
Added proper debugging macro instead of dprintf() usage - disabled
debugging output.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:41:48 +00:00
Axel Dörfler
952d67454e Now make sure that the kernel address space translation map is initialized
correctly by calling arch_vm_translation_map_init_kernel_map_post_sem().
dump_aspace() now behaves like all debugging functions should behave: it
now accepts decimal numbers as well as hexadecimal numbers as IDs.
vm_translation_map_create() was renamed to arch_translation_map_init_map().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9427 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:38:05 +00:00
Axel Dörfler
189a0b84e6 Renamed all externally available functions to have the arch_ prefix.
Moved some functions around, so that the public functions come last.
Renamed the internal vm_translation_map_quick_query() to early_query(),
renamed vm_translation_map_quick_map() to arch_vm_translation_map_early_map().
Removed the _module part of the initialization functions.
Added a function that completes the initialization of the kernel map (it
creates the map's lock, which was just not done before).
arch_vm_translation_map_init_map() will now fail with an appropriate
error code if the map's lock couldn't be created for anything that
is not the kernel map.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9426 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:35:30 +00:00
Axel Dörfler
10abe59096 Since only the arch dependent code may know how much memory the boot
loader preallocated, arch_vm_init_end() (formerly called _endvm())
now calls the new vm_free_unused_boot_loader_range() with the correct
parameters.
Moved the creation of the DMA area from 0-0xa0000 into arch_vm_init_post_area().
Changed return types to status_t rather than just having "int" stand
for a status code.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9425 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:25:32 +00:00
Axel Dörfler
8d7e89291f The VM init calls were renamed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:21:07 +00:00
Axel Dörfler
027c6be29f Updated due to changes to the kernel_args frame buffer structure.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 23:07:19 +00:00
Axel Dörfler
11f838fbf7 Updated due to changes to the kernel_args frame buffer structure.
Most importantly, it now always uses map_physical_memory(), and no longer
relies on eventually mapped data by the boot loader (that the VM didn't
know about).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9418 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 17:17:04 +00:00
Axel Dörfler
9f89132031 Updated due to changes to the kernel_args frame buffer structure.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 17:13:09 +00:00
Axel Dörfler
184d298298 Now maintains the new kernel_args addr_range array in the kernel_args structure.
Exports the new insert_address_range() function as declared in boot/addr_range.h.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 17:11:23 +00:00
Axel Dörfler
1e25c041ec Removed kernel_args::str initialization, since it is no longer there.
Added a kMaxKernelSize constant to be able to change that limit a bit
easier.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 17:08:31 +00:00
Axel Dörfler
a3a0808085 Updates due to the changed frame buffer part in kernel_args.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 17:07:01 +00:00
Axel Dörfler
8df71f7876 Fixed compilation with debug output enabled.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-19 00:31:54 +00:00
Axel Dörfler
db01e67532 Added a comment about what vm_alloc_from_ka_struct() is used for.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 15:56:08 +00:00
Axel Dörfler
0d2dca3b56 That requirement hasn't changed with the name :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 15:43:16 +00:00
Axel Dörfler
2fdc57b522 BeGeistert checkin: fixed broken allocation length as found by the USE_WALL
feature.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9398 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 15:39:21 +00:00
Axel Dörfler
cc0c987a28 No longer relies on certain allocation aligments of malloc(), and instead
uses the new memalign() call.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 15:36:31 +00:00
Axel Dörfler
09ff55a821 BeGeistert checkin: we now have memalign() - and because of that, the
USE_WALL feature can now be used.
Started implementing a USE_CHECKING_WALLS feature, that has a kernel
daemon running that periodically checks the walls of *all* memory
allocations - does not work yet (because of some initialization order
problems).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 15:29:17 +00:00
Axel Dörfler
e1e5a66bc2 BeGeistert checkin: wait_for_child() does now work as expected for any
team and process group IDs as well.
Added a ToDo item that process groups do only work well as long as
their group leader is still active.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 15:16:00 +00:00
Axel Dörfler
b767f41204 BeGeistert checkin: if B_RELEASE_ALL is used, the "count" argument should be
ignored completely (so that zero and below become valid).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 15:14:03 +00:00
Axel Dörfler
85fa73ff32 stdio does work, too.
Now uses waitpid() instead of wait_for_thread() - and surprise, it doesn't
work yet :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9372 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-15 17:00:51 +00:00
Axel Dörfler
2b6c3301f7 Forgot to put the forked team into its parent group in fork_team() - which
resulted in a nice crash on exit.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-15 16:14:51 +00:00
Axel Dörfler
8cab02c5ce Removed the TRACEPFAULT macro, as it's not really that useful.
Fixed some warnings with debug output enabled.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-15 16:06:14 +00:00
Axel Dörfler
8593dcc214 Being on a kernel stack doesn't mean we didn't come from userland: we now
no longer pop %fs from the iframe in that case, too.
When we restore a custom stack, however, we'll now pop %fs from the iframe
as such strange threads may even do their own business with it.
Added some comments.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9369 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-15 15:50:41 +00:00
Axel Dörfler
d296d770a3 %fs won't be adopted from the iframe anymore, we don't need to change it there.
We also should disable interrupts in arch_restore_fork_frame().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9368 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-15 15:47:34 +00:00
Axel Dörfler
ba9c55b555 Sure, that bug waited *that* long to pop up.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9367 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-15 14:20:51 +00:00
Axel Dörfler
a7fa05a54b Since arguments may on the stack even in the kernel, load_image() now
always copies the arguments and environment arrays.
No need for the "owns_arrays" in team_arg anymore - it now always owns
them.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9363 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-15 01:52:07 +00:00
Axel Dörfler
4578da13a4 main() now waits until interrupts are available before bringing the device drivers up.
Switched to load_image() instad of using the old team_create_team() to start "init".


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-14 18:18:22 +00:00
Axel Dörfler
bd4b903e57 Switched from the old team_create_team() to a load_image() compatible mechanism.
The path name is now always taken from the provided argument list (except for
_user_exec() which now replaces args[0] with the path argument).
The team_arg structure know nows if it must delete its arguments or not - this
also fixes a memory leak in case team_create_team() failed when invoked from
userland.
load_image() is now also exported for the kernel.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9360 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-14 18:07:04 +00:00
Axel Dörfler
4496669366 Added minimal fork() test app.
Enhanced exec_test.c to use some process functions as well.
Switched to load_image() instead of using the old _kern_create_team() syscall.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-14 17:52:41 +00:00
Axel Dörfler
dc0f47e390 Implemented load_image() using the new _kern_load_image() syscall.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9358 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-14 17:49:58 +00:00
Axel Dörfler
beee70da41 Changed system() to use load_image() instead of the old _kern_create_team() syscall.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9357 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-14 17:47:49 +00:00
Axel Dörfler
eb89cb7f1d The currently predefined PATH variable missed its single most important path (/bin) :).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-14 17:44:09 +00:00