Commit Graph

707 Commits

Author SHA1 Message Date
Axel Dörfler
8cd0fe6e99 Added new doubly-linked list implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2484 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-18 14:15:20 +00:00
Axel Dörfler
5afbd29256 Added new files to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-18 14:14:07 +00:00
Axel Dörfler
457f7be6f9 Now uses the new list primitive instead of its own implementation (for linking
the vnodes of a mount structure).
Removed stubs for send_notification() and notify_listener() (they are now located
in message.c and node_monitor.c).
Added support for the node monitoring service.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-18 14:13:44 +00:00
Axel Dörfler
a7d654ad0a Added almost complete node monitor implementation - support for watching mounts/
unmounts is not yet implemented.
Added an empty implementation for send_notification() - the function that is
(or will be) able to send out BMessages from within the kernel; currently
just prints out what should be done.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-18 14:11:02 +00:00
Daniel Reinhold
d73534e172 added scanf() to stdio
(very curious that this was not already in there!)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-18 09:29:44 +00:00
Michael Phipps
6c18c9fa14 Small changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2466 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-17 01:40:36 +00:00
Michael Phipps
fa0e80da02 Small fixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2465 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-17 00:54:52 +00:00
Axel Dörfler
4530a79f4f Forgot a return value in remove_images().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-13 16:37:47 +00:00
Axel Dörfler
81ff593b02 Added .fini section to the ld scripts.
Fixed a bug that asked ld to discard the .dtors section.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-13 11:28:36 +00:00
Axel Dörfler
4f8cebc925 Fixes the build of rld.so, removed unneeded entries in librld.a.
libglue(2).so are now using the new startup code.
libroot.so now statically links against libgcc.a for now (to be able to load
BeOS executables).
Added some comments.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2449 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-13 11:25:52 +00:00
Axel Dörfler
b8000952ca Implemented BeOS compatible startup code.
This has almost the same layout as in BeOS - the only difference is crt0.o which
is what is usually provided by crti.o/crtbegin.o/crtend.o/crtn.o. When we want to
move to GCC's crtbegin/end code, we have to introduce crti.o and crtn.o. This is
required because the crtbegin/end stuff assumes to be inserted between a function
start (crti.o) and a function end (crtn.o) - which can only be achieved with assembly,
and is therefore platform dependent.
start_dyn.c is used for executables and calls main() (among other).
init_term_dyn.c functions are called from the .init/.fini sections and search
for B_INIT/TERM_BEFORE/AFTER_FUNCTION_NAME, and execute them if they are present.
Both use BeOS compatible call scheme but add parameters to the end.
lib0.c is no longer needed, because init_term.c/crt0.c replace its functionality.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-13 11:18:01 +00:00
Axel Dörfler
f4c8b1eb40 Added support for BeOS executables, and the .init/.fini sections.
Note, the _start() function is now called with 4 parameters, because BeOS
requires the first three (the fourth isn't used in BeOS executables).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-13 11:08:18 +00:00
Axel Dörfler
dd6f547c66 Moved "__progname" from startup code to libroot_init.c (because BeOS start_dyn.o
doesn't export it), initialization has also moved to initialize_before().
Added BeOS compatibility stubs to allow execution of BeOS native apps - added
comments to every function; some of them might be removed later on again.
Also moved "environ" to posix/stdlib/env.c for the same reason.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2446 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-13 10:50:14 +00:00
Axel Dörfler
75b2a820de Updated to be a bit more BeOS compatible (now calls B_INIT_BEFORE/AFTER_FUNCTION_NAME
instead of "INIT_BEFORE/AFTER_CTORS".
Uses the new runtime linker exports.
Note, this is not yet BeOS compatible (will need to have init/fini sections)!


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 17:22:45 +00:00
Axel Dörfler
e6e5ebbc10 Added a comment about the "non-thread-safety" of gStatus (dlerror()).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2440 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 17:16:20 +00:00
Axel Dörfler
7dce97278f Implemented the unix dlfcn API; note, the RTLD_xxx modes are not yet supported
by the loader. dlerror() is not thread-safe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 17:15:17 +00:00
Axel Dörfler
eadb1c453a Now calls the __init__image() initializer function.
INIT_BEFORE_CTORS() is now called initialize_before() to be compatible
with BeOS start_dyn.o.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 17:13:32 +00:00
Axel Dörfler
f9f3e26e3c Implemented the complete BeOS image API, added kernel image API syscalls,
added it to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 17:11:53 +00:00
Axel Dörfler
0c79589d60 First set of changes to have a BeOS compatible runtime loader.
Added a simple locking strategy to the loader (didn't do any locking before),
it now uses a global recursive lock for the exported API.
Implemented all needed functionality for the BeOS image API.
Now registers images with the kernel.
Added several ToDo items.
Cleanups, and possibly more I've forgotten about.
(hope this works since the local diff does not?!)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2436 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:59:18 +00:00
Axel Dörfler
077020137d Just cleanups, commented out unused code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:54:38 +00:00
Axel Dörfler
2a2cf1b8f5 Just some cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:53:36 +00:00
Axel Dörfler
9bbbc67386 Removed the export prototypes - this is now completely done in rldexport.c.
Now more dynmodule_id; it now uses the image_id directly.
Updated for the other changes to the functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2433 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:51:15 +00:00
Axel Dörfler
24154245f1 Fixed a comment.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:48:48 +00:00
Axel Dörfler
f351df0829 Moved export stuff to rldexport.c, rldexport_init() is now also called.
Cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2431 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:48:09 +00:00
Axel Dörfler
0119ceeb8e Implemented the runtime linker export API.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:37:40 +00:00
Axel Dörfler
2700a953b9 Removed rldunix.c and rldbeos.c as they are no longer needed.
The runtime linker now exports the API in rldexport.c


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:32:30 +00:00
Axel Dörfler
1da55179ee thread_exit() now removes the registered images when the team goes down.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2427 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:30:09 +00:00
Axel Dörfler
c8019cad42 Added support for the image queue in the team structure.
Adapted because of changing structure names (struct uspace_program_args).
Added comments, fill_team_info() now sets the team_info.image_count correctly.
Some cleanups and style changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2426 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:29:28 +00:00
Axel Dörfler
75dccdb63c Added the image API syscalls.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2425 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:27:03 +00:00
Axel Dörfler
598e865517 Added image.c to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 16:26:39 +00:00
Axel Dörfler
515a4a6590 Implementation of the kernel part of the image API.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 15:58:08 +00:00
Ingo Weinhold
4a05764e4b Some smaller changes concerning the scanning of the settings file to make it behave more like BeOS.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-12 14:42:09 +00:00
Axel Dörfler
1ff1332c77 The bootmaker now defaults to the endian of the host platform.
Fixed style issues.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-10 11:48:38 +00:00
Michael Phipps
8bd24c033e Moved Tests
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2398 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-10 01:20:51 +00:00
Michael Phipps
f767d0eeab Changes due to better testing
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-10 01:19:16 +00:00
Michael Phipps
cf7199ba56 Many changes due to enhanced testing.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-10 01:09:45 +00:00
Axel Dörfler
4fff689f48 Some minor updates:
arch_cpu: could have used the TLS_SIZE macro in one place, removed
a now unused variable, assignments to tss_loaded are now booleans.
thread.c: added the new fields to _dump_thread_info().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-08 09:27:55 +00:00
Axel Dörfler
dd8e42a8b4 Also changed the (void *) to (void **) variable in tls_address() here
(the same change has already been done in support/TLS.h).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2392 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-08 09:14:16 +00:00
Axel Dörfler
f9afe354bf Added some calls to find_thread(NULL) which does now work as expected
(as it uses TLS, have a look at OS.h).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:56:33 +00:00
Axel Dörfler
20726b7fb1 _create_thread() now correctly allocates the stack with REGION_ADDR_EXACT_ADDRESS
from the USER_STACK_REGION (until B_BASE_ADDRESS is available), made it much better
readable. It now grows from the lower USER_STACK_REGION up to the start of the main
thread's stack location.
Calls arch_thread_tls_init() and accounts for the TLS area in the stack region.
Added some comments, some cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2382 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:48:01 +00:00
Axel Dörfler
59cbb92fdf team_create_team2() now also allocates a region for TLS in the primary stack
area. It now also calls arch_thread_init_tls(). Cleaned it up to make it more
readable, added some comments.
Some other cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:40:59 +00:00
Axel Dörfler
2a6fbb7f88 Removed some hard-coded values with definitions (mostly USER_x_SEG in arch_x86.S,
and TSS_BASE_SEGMENT in i386_set_tss_and_kstack() (thanks Daniel for pointing this
out)).
Added a arch_thread_init_tls() function which fills the reserved slots - the find_thread()
inline asm in OS.h is finally working.
Added some more comments, resolved the ToDo items from last time :-)
arch_thread_context_switch() now calls set_tls_context() at the correct location.
arch_thread_enter_uspace() now calls set_tls_context() as there is no context
switch in this case for the current thread after TLS has been set up, and it
now gets a pointer to the thread structure directly, and calculates the user
stack top itself, rather than the callee.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:33:30 +00:00
Axel Dörfler
ccfdaba3e9 Moved the errnop() function to the new TLS stuff.
We now have a separate errnop() for the kernel, which just references
a field in the thread structure.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2376 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:08:44 +00:00
Axel Dörfler
2d6ab447f9 Moved arch-dependent stuff to the correct location, no more #if __INTEL__
anymore.
Adapted tls.c to honour the reserved slots.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2375 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:05:27 +00:00
Axel Dörfler
0464331f06 The main thread didn't wait for the other threads.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:01:51 +00:00
Axel Dörfler
f143877df9 _start() now uses set_segment_descriptor() to initialize the GDT instead of
the direct values.
Some cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2369 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:33:59 +00:00
Axel Dörfler
39c5004d20 Replaced the select_test application with tls_test in the boot image.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2368 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:31:26 +00:00
Axel Dörfler
19321ae5a8 Temporarily removed arch_selector.c from the build - it's currently not used
at all, and assumes a fixed and wrong number of preallocated GDT entries.

Implemented TLS: there is one GDT entry per CPU. If a context switch happens,
the FS register of the new thread is set to the matching GDT, and the GDT is
changed so that it points to the current thread's TLS storage area.
This area currently resides unsafely at the bottom of the user stack - for
some reason I could not figure out, it doesn't even work correctly most of
the time (it segfaults when accessing a slot via FS). I've added a ToDo item
explaining the situation - hopefully I have more ideas when I slept a bit more...

The GDT is now no longer static in arch_cpu.c and has been renamed from gdt to
gGDT. It's now also referenced in arch_thread.c, and it would make sense for
arch_selector.c to use it as well (instead of another local copy).
arch_cpu_init2() now uses the set_tss_descriptor() inline function and the
TSS_BASE_SEGMENT macro to set up the TSS section. It now also sets up the
TLS segment descriptors (as TSS, one entry per CPU).

Since I removed desc_table from the headers (the GDT is now a (segment_descriptor *)),
I added it locally to arch_int.c.
i386_enter_uspace() now don't set the FS register to 0x23 anymore, since it's
now already set correctly at the end of arch_thread_context_switch().

Some clean-ups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2366 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:25:01 +00:00
Axel Dörfler
722bf47f67 Added some ToDo items.
Smaller cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2365 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:10:54 +00:00
Axel Dörfler
1d661e3285 Just slightly changed a comment; there was more, but I removed that, and
I was too lazy to revert that little change back, so that I would be able
to write this short paragraph explaining what I've done.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2364 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:10:03 +00:00
Axel Dörfler
d703e5451d Removed an XXX comment question, and replaced it with an explanation of the
issue.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2363 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:08:13 +00:00
Axel Dörfler
831e32af8c Userland part of the TLS implementation for x86.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:05:09 +00:00
Axel Dörfler
1f149d94c4 Added a simple TLS test app.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:04:21 +00:00
Michael Phipps
954674ddf8 Changes to mmap to make COPY and SHARED work correctly (I hope)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2358 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 04:49:58 +00:00
Axel Dörfler
50808915da Removed unused file int.c.
Minor style changes in arch_vm*.c


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2352 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-02 13:56:53 +00:00
Axel Dörfler
e8bfc82801 Removed config_manager from the old location (now in src/add-ons/kernel/bus_managers)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2351 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-02 13:23:06 +00:00
Axel Dörfler
c893786008 Exported the whole known driver module API - not implemented yet, though.
Removed the probably broken bus module info.
Renamed functions cfdm -> driver, cfbm -> bus.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-31 18:33:32 +00:00
Axel Dörfler
ed5c11d75a Included NewOS change 1674 - moved architecture dependent part of elf.c
to the correct location.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2319 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-30 13:33:22 +00:00
Axel Dörfler
7747cd8133 Included Travis' change 1687.
Cleanups, added TRACE() debugging macro instead of commented dprintfs.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2318 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-30 11:18:57 +00:00
Axel Dörfler
2d4d170f83 Some cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2317 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-30 11:17:36 +00:00
Michael Phipps
bf738c95da Added the device driver API that Axel reminded me about.
Updated the TODO list. This is 99% feature complete.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2271 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-21 07:47:05 +00:00
ejakowatz
b6b5037ebe Added a *lot* of error strings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2269 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-18 07:34:58 +00:00
stmansfield
84119b81af Addeded parenthesis around assignment/comparison statement
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2267 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-18 05:07:54 +00:00
Michael Phipps
8f72c5bcf2 Fixed a bug in the vnodeManagement
Added statistics counting.
Started down the path of making various tests share one VM space.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-17 02:28:39 +00:00
Michael Phipps
ad5da074bb Removed items, updated items, reordered my priorities...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2249 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-15 07:08:41 +00:00
Michael Phipps
ceb3763e56 Implemented the sharing of vnodes. Hopefully mmap and file cache and cloned
areas will not step on each others feet...
Added comments all over the place.
Bugs squished


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2248 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-15 07:05:38 +00:00
Axel Dörfler
ce29ea4e8f Removed it again :-)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-10 04:27:38 +00:00
Axel Dörfler
796a8651e9 Added a skeleton for the image API. Contains almost no code yet, though, only
some structure definitions (to outline some basic ideas), and the symbols
exported to userland.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-10 03:36:18 +00:00
Axel Dörfler
d768457f49 Included NewOS change 1685 in OpenBeOS; a fix for the VM.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2190 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-08 23:12:09 +00:00
Philippe Houdoin
a4d52d3edf Add missing headers/os/drivers/KernelExport.h functions here and there.
Some int -> cpu_state cleanup on the way, and implement the
B_KDEBUG_CONT and B_KDEBUG_QUIT features in our kernel debugger.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2173 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-07 00:25:50 +00:00
Axel Dörfler
424880282f Fixed a warning.
Replaced "int state" with "cpu_status state" where appropriate.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2160 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-04 16:40:07 +00:00
Axel Dörfler
fb101ff170 Completely rewritten the module iterator code. Fixed many bugs in that
code and made it much simpler (it now just uses a stack of path names
instead of this complex doubly-linked module_iterator_dir list).
Now works together with the rest of the code without making any problems.
Added a module_test() function which iterates over all existing modules.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2149 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-03 17:54:09 +00:00
Axel Dörfler
ac5b2b4ece bootfs_read_dir() and devfs_read_dir() both returned B_ENTRY_NOT_FOUND
instead of B_OK for the last directory entry.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2148 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-03 17:49:28 +00:00
Axel Dörfler
744761bf27 Removed the team->path variable. Renamed ioctx to io_context.
Some cleanups, moved user_*() functions to the end of the file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2144 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-03 14:17:53 +00:00
Axel Dörfler
1291a19d84 thread->page_faults_allowed is now initialized.
Updated due to the ioctx -> io_context change.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2143 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-03 14:11:35 +00:00
Axel Dörfler
5cdaa5176e Now panics if page faults are forbidden and happen anyway.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2142 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-03 14:10:34 +00:00
Axel Dörfler
52bd3fc17c Implemented forbid_page_faults() and permit_page_faults(), added a new
field to the thread structure to keep track of the current state.
forbids/permits can be nested.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2141 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-03 14:09:43 +00:00
Axel Dörfler
aeb5053982 Added empty (until TLS steps in) function stubs for:
permit_page_faults(), and forbid_page_faults().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-03 01:50:55 +00:00
beveloper
7d9fdf5918 make sure that the stack page is in place before disabling interrupts.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2125 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-30 02:36:31 +00:00
beveloper
c0d31b20ab Fixed the detection of page faults that happen while interrupts were
disabled. If a page fault happend while a interrupt handler is executed,
or while a section of code is running with interrupts disabled (with the
exception of the initial kernel startup), the page fault handler will
now panic, to give you the chance to fix the bug.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2124 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-30 02:01:29 +00:00
Axel Dörfler
edd97f84ad Fixed return code (using errno) of readdir().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:47:01 +00:00
Axel Dörfler
750a82c5d3 Added new debug output macros (TRACE()).
thread_exit() for now prints a warning if it was called with interrupts
disabled.
Fixed a bug in thread_exit2() that restored the interrupts too early,
instead of simply enabling them (and restoring them later) [found by
Marcus O. great debug additions].
Fixes for the khash changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:42:52 +00:00
Axel Dörfler
14d9bcd728 Fixed two warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:39:34 +00:00
Axel Dörfler
3ae9bebe33 Fixes for the khash changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:38:52 +00:00
Axel Dörfler
fc88dc959f Added a missing include (and fixed a warning this way).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:37:19 +00:00
Axel Dörfler
8a91be0446 Removed two warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2115 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:36:42 +00:00
Axel Dörfler
8a531eeb0a Fixes for the changes in khash.
Now the d_reclen field of struct dirent is correctly calculated in all
file systems (read_dir() function).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:36:05 +00:00
Axel Dörfler
b9b1c1c4f5 Almost completely rewritten module.c. Locking now works correctly, memory
leak fixed, some other bugs fixed, removed the global queues as there weren't
needed and used at all, moved to the other hash table implementation
(because the new_hash_table stuff was buggy). Should really work okay now :-)

Added the last missing function get_next_loaded_module_name() - I am not
sure the Be version works this way, but we could easily change that after
actually having found out how that one is really working.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:33:57 +00:00
Axel Dörfler
d92e4b19e4 Completely removed the buggy, inflexible, and incomplete new_hash_table
implementation.
Some cleanups of the other code.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2112 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-29 08:30:20 +00:00
beveloper
0010bfc64f the new_hash_table code has a larger number of problems
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-28 17:34:55 +00:00
beveloper
428f0ce25c last cleanup of pool code before rewriting it
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-28 15:05:58 +00:00
beveloper
9c2992c73b fixed debug function
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2105 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-28 14:41:06 +00:00
beveloper
9eb6ed8082 disable interrupt check when in a panic() context
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2104 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-28 14:11:08 +00:00
beveloper
3b70f94330 added a magic value to check clobbering of the free list
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-28 14:10:20 +00:00
beveloper
7991b1a031 added a lot of debugging functions that should help fixing bugs
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2099 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-28 02:25:04 +00:00
Michael Phipps
42ff0425a7 Fixed more bugs; simpleTest now seems to work correctly.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-24 05:12:50 +00:00
Michael Phipps
cc22bcb449 Fixed some bugs. Yet another checkpoint.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-24 04:16:06 +00:00
beveloper
d8dd74308e Optimized (yes, we shouldn't do it now) to consume less power on P4,
and to have better performance on Hyper Threading systems. Should be
backward compatible with all x86 systems, according to Intel documentation.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-23 17:43:36 +00:00
Axel Dörfler
fe8ba34097 Removed raise.o from the kernel posix lib, because find_thread() is currently
missing there.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-20 02:15:29 +00:00
Daniel Reinhold
ca60e89ab7 replaced syscall with find_thread(NULL) to obtain current thread id
currently, find_thread(NULL) also uses a syscall, but in the future,
this will be implemented as an efficient inline lookup in calling
thread's local storage


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2017 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-19 20:57:55 +00:00
beveloper
d55c9bd082 moved queue initialization into int_init2()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2016 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-19 11:53:41 +00:00
Daniel Reinhold
89feafabe5 fixed call to thread_get_current_thread_id()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-19 06:44:51 +00:00
Daniel Reinhold
690fa06644 restored SYSCALL_GET_CURRENT_THREAD_ID -- my mistake, it was fine as it was
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-19 05:51:13 +00:00
Michael Phipps
bc6600175c Mega changes. Using hash tables.
Many bug fixes
Some formatting changes.
Introduction of vnodeManager - to allow cached, opened and mmapped files to
work together in love, peace and harmony.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-19 04:05:16 +00:00
Daniel Reinhold
d3aaf99b1e ok, the second time's a charm
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 07:47:53 +00:00
Daniel Reinhold
88a621e159 call to raise() un-commented now that raise() is implemented
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 07:45:26 +00:00
Daniel Reinhold
e8b75a376a sigset stuff added to the build
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 07:36:22 +00:00
Daniel Reinhold
f30083eaa8 initial checkin
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 07:35:55 +00:00
Daniel Reinhold
eb64dfc217 more functions added to the build
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 02:39:44 +00:00
Daniel Reinhold
ae130fe5c1 another one
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 02:33:38 +00:00
Daniel Reinhold
7f04740599 added sigaction()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 02:29:57 +00:00
Daniel Reinhold
274dff2fe0 added raise() and signal()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 02:24:28 +00:00
Daniel Reinhold
715f76df9e added sys_get_current_thread_id() -- for libroot compatibility
some minor rearrangement (sys_xxx() calls now placed together)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 02:04:57 +00:00
Daniel Reinhold
898852b6b5 fixed SYSCALL_GET_CURRENT_THREAD_ID (was calling a function that had been removed)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 02:00:38 +00:00
Daniel Reinhold
42bef465fa added sys_send_signal()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1995 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 01:58:00 +00:00
Daniel Reinhold
68e8d1f65e libroot/posix/signal is back in the build
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 00:42:48 +00:00
Daniel Reinhold
453532db1c moved the string table definition to libroot where it belonged
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-18 00:39:41 +00:00
beveloper
725e25d182 unlock the spinlock
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1979 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 13:32:05 +00:00
Daniel Reinhold
03a21dd59a removed libroot/posix/signal from the build temporarily
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 11:49:35 +00:00
Daniel Reinhold
ead782086a the beginnings of signal support in libroot
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 05:04:08 +00:00
Daniel Reinhold
062dc34181 the signal string table was fixed to contain proper
output strings -- the old debug table is still there,
now renamed 'sigstr[]'

MAX_SIGNO replaces 32 in several spots


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1976 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 04:49:14 +00:00
Axel Dörfler
cc4445505e Fixed some issues in int.c.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 01:59:31 +00:00
Axel Dörfler
d5bb31991f Checked one of Marcus' comments in int.c, and changed the list initialization
to use the newly provided function for this.
module.c now also uses the initque() function, some minor cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 01:38:35 +00:00
beveloper
b795251564 This code seems to have some issues. Please check.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1971 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 00:52:43 +00:00
beveloper
42acb44c35 added a couple of debugging checks into the spinlock functions
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-17 00:28:32 +00:00
Axel Dörfler
0fe40cc315 Added the time module to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-16 17:47:34 +00:00
Axel Dörfler
d3243d719b Added an empty time() implementation (just returns zero) to let the kernel
build again.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1959 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-16 17:43:28 +00:00
Axel Dörfler
6c45733119 The traps of copy & paste - this time it should really work...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-15 22:52:49 +00:00
Axel Dörfler
90b31eb333 Before starting to implement a function, you should know what to do ;-)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-15 22:48:14 +00:00
Axel Dörfler
0dd93a6eb7 Implemented utime().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1952 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-15 22:44:08 +00:00
Ingo Weinhold
8a425955c5 The header is now compatible with R5's libroot.so.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-15 17:37:55 +00:00
Axel Dörfler
2a86e17450 Added a missing "lock" in atomic_set().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1931 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-14 01:05:28 +00:00
Axel Dörfler
cd3ea5f216 vnode_path_to_vnode() now correctly asks for access permissions when traversing
the directory tree.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1904 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-11 12:14:19 +00:00
Axel Dörfler
64d41f033f (Almost) completely rearranged the kernel build; main issues aren't fixed
yet, but the jam problem is gone and some bugs fixed.
We are now using merged objects to bind different functionality together,
which simplified the kernel Jamfile a lot.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1841 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-04 19:06:44 +00:00
Axel Dörfler
e729eba84d Merged several object files together - there are now posix_xxx.o and
kernel_posix_xxx.o, where xxx stands for stdio/stdlib/unistd/...
sleep.c and usleep.c no longer reference sys_() calls directly, but
call the OS functions instead (snooze_until(), and system_time()).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1839 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-04 18:49:49 +00:00
Axel Dörfler
66ebd69087 Added select.c to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-03 17:39:33 +00:00
Axel Dörfler
02e25990ee Add poll.c to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1834 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-03 17:39:10 +00:00
Axel Dörfler
c852811405 Added syscalls for select/poll.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1832 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-03 03:23:50 +00:00
Axel Dörfler
ed622838f5 Moved the select/poll implementation into its own file (vfs_select.c).
Fixed some minor a larger issues (one memory corruption due to the use of FD_ZERO()).
notify_select_event() is no longer binary compatible (hasn't been used on R5).
Added syscalls for select/poll in the syscall dispatcher.
Fixed some debug output in fd.c, adapted for the new notify_select_event()
call.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-03 03:19:34 +00:00
Axel Dörfler
90b544f75f Forgot to remove the const from the strerror implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-02 02:52:56 +00:00
Axel Dörfler
b612edb0d7 Added a simple select() and poll() test application - it's not yet added
to the build because I still need to look into those build issues...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1812 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-01 03:03:12 +00:00
lillo
2b1e7eaca7 some more small fixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1805 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-31 14:32:56 +00:00
lillo
5e7d6a17a0 Enabled the single ordered queue scheduler and made some little fixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1804 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-31 13:20:00 +00:00
Axel Dörfler
dbf1da160b Userland implementations for select(), pselect(), and poll().
Not yet added to the build because other stuff is missing, and there is
a problem with jam I have to sort out before I add the missing things.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-30 02:33:16 +00:00
beveloper
8bcfda04d9 might work better
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1777 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-30 02:10:06 +00:00
Axel Dörfler
41691b996a Replaced kmalloc(), kfree(), and kstrdup() with the POSIX equivalents.
Implemented realloc().
Adapted all other sources, some minor cleanups in some files as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-29 23:07:06 +00:00
Axel Dörfler
4a2e58074d select_info had the wrong size (uint8 instead of uint16).
Corrected POLLNVAL handling.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-29 05:41:10 +00:00
Axel Dörfler
c4943b79fe Forget to free the data allocated in common_select(), and common_poll()...
Changed the header guard in vfs_select.h.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-29 04:21:22 +00:00
Axel Dörfler
1e7eb4c232 Some style cleanups in khash.c - I just realized that we have two different
hash implementations in that file... we should really remove one of them.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-29 04:03:13 +00:00
Axel Dörfler
58ec046735 Added support for select(), and poll().
Not yet tested.
Moved the CHECK_USER_ADDRESS() macro from vfs.c to kernel.h.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-29 03:54:07 +00:00
Axel Dörfler
88fae79de6 Moved queue functionality out of module.c and into kqueue.h.
Changed module.c and int.c to use that one.
Some minor cleanups in module.c.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-29 03:42:40 +00:00
lillo
f2bc61304f replaced sys_kill with general thread-aimed sys_send_signal; cleaned up
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1740 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-28 20:38:16 +00:00
lillo
a2117f0bc7 reworked snooze to work in function of the newly added (and kernel exported) snooze_etc. Activated libroot counterpart(s).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-27 12:06:40 +00:00
Daniel Reinhold
79362df9f7 added macros PI and PI2, and fixed previous (invalid) references to these
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1711 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-27 01:36:45 +00:00
Daniel Reinhold
02f348e2cb added localeconv to the build
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1706 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 21:46:35 +00:00
Daniel Reinhold
952977a190 initial locale support
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 21:41:49 +00:00
Daniel Reinhold
4555e63fe4 fixed typo
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 21:35:26 +00:00
Daniel Reinhold
568244c42e added strtod() and atof() to the build
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 21:31:56 +00:00
Daniel Reinhold
21d3063840 initial checkin
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1702 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 21:23:22 +00:00
Daniel Reinhold
0029fd4b09 hmmm... need to learn how to alphabetize ;-)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 21:16:55 +00:00
Daniel Reinhold
a9a82bf002 added math_globals to libroot/posix/math build
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1700 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 21:11:12 +00:00
Daniel Reinhold
c4b1aad976 updated files to use the new private libroot include directory
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 20:39:16 +00:00
Daniel Reinhold
5a1e90ba77 defines an internal global variable required for linking
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1695 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 20:38:10 +00:00
beveloper
6652c2eae9 removed some unused headers
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1688 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 19:27:39 +00:00
Daniel Reinhold
1c7200419b changed to wrappers for strtol(), etc.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 19:11:18 +00:00
Michael Phipps
3dcf5034e5 Checkpoint - more work done.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1685 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 18:55:44 +00:00
lillo
5cdacbaabb *LOTS* of small changes to make the kernel compatible with Be's KernelExport.h
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 16:13:36 +00:00
lillo
343b352fe1 Signals, 2nd pass: syscall restarting now only works on EINTR (removed other exotic retcodes like ERESTARTSYS); signal handlers now receive 3 args, and the vregs struct is used to save the signal context, making the system beos compatible.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 13:31:22 +00:00
beveloper
06d016b380 renamed thread_entry
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1678 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 12:58:52 +00:00
lillo
8fe70e8212 beos compatibility fixes: exit_thread now issues a signal; wait_for_thread returns B_INTERRUPTED if target thread gets killed
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1674 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 01:11:15 +00:00
Axel Dörfler
a86569deee There were two positions where I had to change those values. %lld and %Ld
should now finally work (thanks to Marcus).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 00:59:16 +00:00
Axel Dörfler
4d78ef5224 Added %Ld to vfscanf() as well.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 00:52:17 +00:00
Axel Dörfler
38903f032b Fixed %Ld handling to be int64 as it is on BeOS.
%lld is now int64 as well.
Cleaned up a little bit (removed K&R style prototypes).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1671 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 00:48:50 +00:00
Axel Dörfler
13bbbc9ac4 Add strtod.c to the build (from FreeBSD).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1668 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 00:33:09 +00:00
Axel Dörfler
65ea9e24b5 Accidently removed linkhack.so from the build in the previous commit.
Added strto[u]l[l] functions to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 00:13:27 +00:00
Axel Dörfler
25c7a73eed Fixed vfscanf() which needed strtoq(), and strtouq().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 00:10:49 +00:00
Axel Dörfler
deab46426d Added implementation for strtol(), strtoul(), strtoll(), strtoull() from
FreeBSD sources.
Added llabs() (and a newline at the end of the file).
Fixed qsort.c and removed the unneeded FreeBSD header - min() wasn't declared.
Added the string conversion stuff to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1665 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-26 00:09:39 +00:00
Axel Dörfler
a8cd036239 Removed strtoq()/strtouq() from the build (both are deprecated functions, and
not available in BeOS, so there is no reason to add them).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1663 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 22:45:23 +00:00
lillo
9870ddcea7 kill now sends the signal to the main thread of a process only. To target a specific thread use the new send_signal syscall. Also added set_alarm.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 22:36:08 +00:00
Daniel Reinhold
9a43926970 removed extra declarations now that stdlib.h is fixed
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 19:25:50 +00:00
Daniel Reinhold
4b28d29d28 type fix: replaced a couple of longs with ints (as they should be)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 11:32:38 +00:00
Daniel Reinhold
afaca44046 type fix: replaced int type with proper wchar_t type for several functions (tsk, tsk, tsk)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1647 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 11:23:30 +00:00
Daniel Reinhold
3b5b78dee6 type fix: replaced int type with proper wchar_t type for variable passed to mbtowc()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 11:21:50 +00:00
Daniel Reinhold
4123d76182 bug fix: addr is an unsigned long, not a pointer type
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 11:08:39 +00:00
Daniel Reinhold
bd2251961c bug fix: pointer indirection error while checking cookie value
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1644 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 11:04:11 +00:00
Daniel Reinhold
95574b3621 fixed printf warning
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 10:53:36 +00:00
Daniel Reinhold
cd6a80d8c9 several additions to libroot:
added abs.c (abs, labs)
  added div.c (div, ldiv)
  added abort() to exit.c


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-24 20:05:09 +00:00
beveloper
9fc7164698 allow building everything without local(tree external) header files beeing
used for kernel or kit components


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1630 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-23 20:13:17 +00:00
lillo
f510e6ce60 posix signals support, 1st pass
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-23 17:31:10 +00:00
Daniel Reinhold
2050c9bb7c put call to exit() back in, now that it's implemented
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-23 13:32:07 +00:00
Daniel Reinhold
997a2a4349 added exit() to stdlib
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1611 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-23 07:27:19 +00:00
Daniel Reinhold
87790d71e6 fixed a minor error and some typos
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-22 11:36:29 +00:00
Daniel Reinhold
4fea1c8ff7 added TLB/Cache information
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-22 10:56:17 +00:00
Daniel Reinhold
98e3e1ff5d implemented the get_cpuid() function in libroot and added a new kernel app 'cpuinfo'
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-20 05:28:35 +00:00
Daniel Reinhold
b52ed331f1 implemented the get_cpuid() function in libroot and added a new kernel app 'cpuinfo'
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-20 04:04:03 +00:00
Bruno G. Albuquerque
3afbe60d92 Fix a bug reported by BeFree. It looks the PCi stiff works now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1567 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 23:11:00 +00:00
Axel Dörfler
28c9a687e6 Added forgotten os/time.o, stdio/fseek.o, and stdio/rewind.o to the build.
Implemented index syscall functions in VFS.
Added fs_index.c to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 19:34:09 +00:00
Axel Dörfler
64b00573d2 Added implementation of the functions in fs_index.h.
Commented system_time() in time.c - it's already implemented in atomic.S (not
that it would belong there).
Fixed linking of rewind.c
Added syscalls for the index functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1565 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 19:30:59 +00:00
Axel Dörfler
b7c42fadf7 Fixed fd lead in opendir() and set errno correctly if memory is out.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1564 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 19:27:03 +00:00
Axel Dörfler
69b81fcc90 Fixes the not POSIX style return codes - fs_*() functions return -1 and set
errno if an error occurs; they don't return the error status directly.
Also fixed a fd leak in fs_open_attr_dir().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1563 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 19:22:04 +00:00
Axel Dörfler
f4e51a2dfb Added a new write_stat() call to the file descriptor operations (plus syscall).
Renamed sys_read_stat() to sys_read_path_stat() - sys_read_stat() is now
the fd operation (same for the corresponding write call).
Removed the sys_write_attr_stat() call because it is no longer needed.
Added stat(), fstat(), and other POSIX calls to the kernel - many are still
missing (mainly from stdio).
Added symbols (but no implementation) for unistd.h's process id functions.
Adapted libroot calls that used sys_read_stat() before to the new architecture.
module.c and bus_man.c now use stat() directly instead of the sys_read_path_stat()
call.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1555 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 03:09:25 +00:00
Axel Dörfler
f6fabd1b6d Added syscalls for the attribute functions and fs_attr.c to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-16 16:14:49 +00:00
Axel Dörfler
b4dabf6063 Implemented all calls in fs_attr.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1544 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-16 16:14:14 +00:00
Axel Dörfler
4544e733cd Removed the debugging stuff I added to vm_page.c - things should now be
much smoother again... :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-14 01:45:15 +00:00
Daniel Reinhold
b4987845fd removed pwd app from the kernel script
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1507 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-13 23:48:28 +00:00
Daniel Reinhold
66972fc258 removed pwd (redundant app, already built into shell)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1493 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-12 18:07:35 +00:00
notion
ea4148fa59 A few quick fixes for some VM bugs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-08 21:16:24 +00:00
Axel Dörfler
ef77a305f8 vm.c: Added user_strlcpy() (and the implementation in arch_cpu_user_strlcpy())
which is now used thorough the VFS code instead of user_strncpy().
fd.c: Replaced some return codes.
vfs.c: joined attr_dir_open(), and attr_dir_open_fd(), added sys_/user_
calls to access attributes, and attribute directory.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1455 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-08 03:24:51 +00:00
Axel Dörfler
edef81d01c Fixed a compilation bug, dunno why this got through...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-08 03:06:55 +00:00
Axel Dörfler
bc9fd4cc49 Removed the stupid debug output I accidently commited, and replaced them
with something useful.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-08 01:14:44 +00:00
Axel Dörfler
f7d5ad8c90 Moved seek functionality from the fs to the vfs.
Renamed read_page/write_page to read_pages()/write_pages()


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1451 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-08 00:42:17 +00:00
Axel Dörfler
c01214de27 Removed the debug output that was accidently added by the last commit.
Included NewOS change 1656 (O_CLOEXEC support, and a bug fix in get_vnode()).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1431 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-07 15:31:40 +00:00
Axel Dörfler
165f8bc071 Added the new files in libroot/posix to the Jamfile.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-06 23:52:14 +00:00
Axel Dörfler
511a61e038 Added BSD's glob & fnmatch implementation (disabled collation stuff).
Added symbol exports for the user/group ID functions, and [sg]ethostname(),
although those are not yet implemented.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1421 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-06 23:51:35 +00:00
Axel Dörfler
94fc97f703 Return type of thread_set_priority() was wrong.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 19:45:31 +00:00
Axel Dörfler
48d81f1962 Cleaned up the source a bit, and rearranged the code, (hopefully) no functional
changes, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 19:38:42 +00:00
Axel Dörfler
362032afbf Removed the contents of the common/ directory.
Cleaned the Jamfile.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1392 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 18:19:18 +00:00
Axel Dörfler
e195c3e79e Added some files that we probably won't need for a while...
(syscalls.inc for other platforms)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 18:09:26 +00:00
Axel Dörfler
fae903cacf Rearranged the Jamfile a bit, moved syscalls.S around.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1390 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:34:09 +00:00
Axel Dörfler
238576af81 Moved the syscalls.S file to the os/ subdirectory (better fits in there).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:33:22 +00:00
Axel Dörfler
55aa2e19ad The test apps now link against libroot.so, not libc/libm anymore.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:19:26 +00:00
Axel Dörfler
4114b4541a Cleaned the Jamfile a bit up (libm.a removed, as it is not needed).
Now builds only libroot, instead of the single libm + libc.
All executables now link against libroot.so instead of libc/libm.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1387 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:18:40 +00:00
Axel Dörfler
bc45af205c Added all former libc/libm files to the libroot/posix directory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:13:32 +00:00
Axel Dörfler
712ec3d786 Added libroot's os/ tree.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:07:03 +00:00
Axel Dörfler
d98c8e6e59 Removed some no longer needed files.
Added new libroot_init (same as libc/nulibc_init.c before).
Updated the Jamfile for the new architecture.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:04:37 +00:00
Axel Dörfler
f7a056e53c Some minor changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 17:00:44 +00:00
Axel Dörfler
68687d6163 Now includes sem.h (since it needs the private create_sem_etc() call).
Cleaned up the source a bit.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1378 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-05 01:20:39 +00:00
Michael Phipps
a550db6753 Checkpoint. Hand examined the code and made several changes/improvements.
Doesn't crash quite as easily. Still some nagging bugs.
Partial implementation of hashTable. Need to make find use keys and do proper
memory allocation (i.e. from physPages, not new).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-03 03:42:59 +00:00
Axel Dörfler
d0286a7395 Added a warning for drivers which don't export the api_version.
Now returns ENXIO if dev_publish_devices() returns an error (instead of
B_OK).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1317 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-30 21:59:09 +00:00
Axel Dörfler
634a41725a The main reason I commit this: the last change also made set_sem_owner() to check
for a valid team id.
Added a comment about a race condition in set_sem_owner().
Some minor style changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-30 03:48:59 +00:00
Axel Dörfler
3fa1fa66f1 Cleaned up the source, made it compatible with our style guide (i.e. global
variables now have the 'g' prefix).
Fixed a very unlikely race condition in create_sem_etc() (can only happen if
that call isn't used properly).
Fixed some wrong return values (i.e. B_BAD_TEAM_ID wasn't returned anywhere).
Optimized _get_next_sem_info(): it now only grabs the semaphore lock
if it has good reason to do so.
Added some comments.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-30 03:43:32 +00:00
Axel Dörfler
79f4cb3e2c remove_fd() is now static.
Added some comments.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-30 03:31:42 +00:00
beveloper
64ea4a7aa7 unified Bochs debugging option
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1305 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-30 02:25:11 +00:00
beveloper
405439be5c unified Bochs debugging option
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-30 02:23:36 +00:00
Axel Dörfler
36cfa7d4f8 The USE_WALL setting currently doesn't work, because
vm_translation_map_create() checks if the kmalloc()'d page is aligned - maybe
we should just disable the USE_WALL setting if size is PAGE_SIZE for now...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1264 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 04:05:18 +00:00
Axel Dörfler
3904aa6bf1 Shouldn't do anything so late; just fixed another bug in the wall code.
Commit early, commit often, they say...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 02:24:42 +00:00
Axel Dörfler
a3da50e5ed Fixed a bug in the wall code that actually produced the bug I mentioned
in the last commit... :/


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1262 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 02:21:22 +00:00
Axel Dörfler
ebe92efe60 Added a front and back wall to each kmalloc() allocation, if USE_WALL is
set to 1 (which it currently is).
I've only used it with bochs yet, and it lets it crash reliably in some
VFS code.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1261 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 01:58:22 +00:00
shatty
2c26aebcd8 changed return types for "std_ops" functions from int to int32, fixes warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1260 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 00:28:57 +00:00
shatty
3192085307 corrected format specifier to remove warning.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 00:25:13 +00:00
shatty
e7d12ece83 corrected format specifier to remove a warning.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-29 00:20:18 +00:00
shatty
1d77ffa596 corrected format specifiers to eliminate warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1257 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-28 23:01:05 +00:00
shatty
8af9ddf336 corrected various format specifiers to eliminate warnings.
also changed the type of msg_code in port_test_thread_func to int32, from int. (warnings)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-28 22:59:06 +00:00
shatty
143c418d4e fixed warnings by changing the return type of the thread_func's to int32.
"int" seems like a better return type choice, but it is int32 in both the Be headers and the OBOS headers, at least for now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1255 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-28 22:47:42 +00:00
shatty
1dabea80a1 fixed warnings by changing the return type of the thread_func's to int32.
"int" seems like a better return type choice, but it is int32 in both the Be headers and the OBOS headers, at least for now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-28 22:40:36 +00:00
Axel Dörfler
75c2064c1a Fixed the crashing bug in the VFS - we can't make any assumptions about
the "device" parameter of fs_mount.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1225 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-28 02:19:26 +00:00
Bruno G. Albuquerque
b1b72e8797 Automatically add the Bochs keyboard hack when --bochs-debug is used in the configure script.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1221 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-28 01:37:00 +00:00
beveloper
5cd2d50a61 Allow using the kernel debugger from inside BeBochs using your local keyboard.
You need to enable BOCHS_INPUT_HACK and type inside the BeBochs window,
NOT inside the Terminal where the output is printed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-28 00:51:38 +00:00
Axel Dörfler
f4b41f88a2 The private data field in the file_descriptor is now a union to hold different
types of objects (currently fs_mounts, and vnodes).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1190 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-26 03:52:10 +00:00
Axel Dörfler
0a2bd16f7d find_mount() must not lock the gMountMutex - the caller must do this; that
also fixed a bug, because fs_read_info()/fs_write_info() already locked the
mutex before calling find_mount().
Implemented the file system API for attribute directories, and index
directories.
Introduced a new macro FS_MOUNT_CALL() to call fs ops directly from the
mount structure.
get_new_fd() now panics if it is called with an unknown fd type.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-26 03:50:14 +00:00
Axel Dörfler
d8f40dbc54 Moved bootfs.h and rootfs.h to src/kernel/core/fs because they are private
to the VFS, not to the whole kernel.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1184 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-26 01:13:42 +00:00
Axel Dörfler
71c882e5f5 Included NewOS change 1642 (argument checking)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-26 01:01:54 +00:00
Axel Dörfler
5f20abf004 Changes due to name changes in the fs API.
Fixed some warnings in fb_console.c


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-25 16:39:42 +00:00
Axel Dörfler
dd36c5aa04 Renamed "calls" to "ops" (yeah, I know, that doesn't make really much sense :).
Completed load_file_system().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1178 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-25 16:34:33 +00:00
Axel Dörfler
e04fced505 The available file systems aren't load anymore on startup.
Reimplemented file system handling, it's now loading file systems on an
on-demand basis - code is not tested yet, but should work!
That also fixed a bug that was in that code before (the image was not
unloaded in case of an error in vfs_load_fs_module()).
Renamed fs_id to mount_id.
Renamed all global variables to have the 'g' prefix in vfs.c.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1175 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-25 14:10:50 +00:00
Axel Dörfler
62781e5bc4 Renamed fs_id to mount_id.
Some clean-ups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1174 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-25 14:05:44 +00:00
Axel Dörfler
99e81006d0 Added some tests against wrong values in simple names, like attribute names,
or entry_ref names (paths are safe).
Implemented attr_remove(), and attr_rename().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1171 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-25 12:13:09 +00:00
Axel Dörfler
0ee7f6972b Rearranged some functions to better fit in their context.
new_file_fd() is now called get_new_fd(), and can also create fds for other
types as well. Furthermore, it lost some memory if it couldn't allocate a
new fd.
Implemented most of the VFS attribute API (kernel internal only), only
remove_attr(), and rename_attr() is missing for now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1168 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-25 02:18:20 +00:00
Axel Dörfler
570b6eaeeb Removed the fs_ prefix from the fs_calls.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1160 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-24 16:17:22 +00:00
Axel Dörfler
d98c7edc06 Fixed more warnings due to the int/int32/status_t change.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1138 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-24 00:08:50 +00:00
Axel Dörfler
e58fbc960b Adapted the VFS and internal file systems with respect to changes made
in fs_interface.h.
Fixed many warnings due to the int/int32/status_t changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1137 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-23 23:24:12 +00:00
Axel Dörfler
fcbbd36ed5 Fixed warnings in smp.c.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1125 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-23 03:06:24 +00:00
Axel Dörfler
f200ef51c2 Fixed status_t/int/int32 issues.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1124 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-23 02:58:03 +00:00
Axel Dörfler
633275adee Fixed some int/int32/status_t issues.
Also kernel/module.h was hidden by os/drivers/module.h - fixed; kernel/module.h
is now called kmodule.h and only contains the module_init() function for the
kernel.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-23 02:41:52 +00:00
Axel Dörfler
beb8d9fd79 Removed bzero.c and bzero.c from the build for now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1121 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-23 02:39:41 +00:00
Axel Dörfler
483f789643 Implemented the driver_settings API. Tested code, works fine.
Only implements access from within the kernel, not from the BIOS. Since
it requires malloc(), realloc(), open(), etc. in the kernel, you can't
currently link it, but it's added to the build anyway (it's just not
linked against the kernel).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-22 15:31:50 +00:00
beveloper
8271683e44 backport a bugfix from newos:
another terrible bug that managed to exist this long and not clobber everything.
  The io vector table was being created with an incorrect size, so all sorts of garbage was getting written to whomever was allocated after it.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1112 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-22 01:00:26 +00:00
Axel Dörfler
32c655168b Added the new string files to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-17 15:02:37 +00:00
Michael Phipps
8aabdd2043 More improvements. Does not run all tests, though - still have some locking issues
around clone area, I think. Still, much improved...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1048 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-16 03:14:44 +00:00
Michael Phipps
5fb6c38b6e Another checkpoint. Big one, this time.
Changed the whole way locking was done. What was I thinking?
Many changes and cleanup ideas from Ingo (thanks!).
Not perfect yet, but much better. Still a few things left to implement
in the COW arena - mmap doesn't use it. Also need to finish the vpageManager
which will cause mmap and cacheManager to use the same vnodes where possible.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1042 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-14 17:03:16 +00:00
beveloper
2be429a65d add extended pointer check to kfree
also initialize newly allocated memory with non zero (0xCC)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-11 12:44:48 +00:00
beveloper
e6d02b3a8b fixed a few bugs
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-11 12:25:47 +00:00
beveloper
ea736e689e moved strlen out of min macro to avoid calling it twice
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-11 12:23:56 +00:00
Axel Dörfler
6cf8d733aa just changed a comment in rootfs_open().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-09 09:51:51 +00:00
Philippe Houdoin
60d8f409a2 Fix a possible crash in rootfs_free_cookie(). Thanks to Thierry Delhaise (befree)
for pointing this one.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-09 07:07:44 +00:00
Axel Dörfler
911a288d35 Fixed a missing pointer initialization (found by Thierry).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@986 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-05 11:18:38 +00:00
Michael Phipps
f89acd8e06 With this change, all memory except for the areaManager is allocated from the
one area that we allocate.
The areaManager should really be created when the process is created, so this
is something to wait for HW integration time.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-05 03:26:02 +00:00
beveloper
e4676f539b Removing the misplaced loop.c file.
The whole current/src/kernel/add-ons/ directoy should not be used.
The correct location for kernel add-ons is current/src/add-ons/kernel/


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-04 23:46:38 +00:00
beveloper
90abd04b34 Change int into status_t, and other changes for better BeOS type compatiblitly.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-03 02:19:22 +00:00
beveloper
75c97114f7 Change int into status_t, and other changes for better BeOS type compatiblitly.
This change also introduces a lot of new warnings concerning printf format
anomalies. Please do NOT fix them. Currently, int32 (and also status_t)
is of type int, but it will be of type long (BeOS compatible) soon, and
these warnings will disasappear.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-03 02:09:48 +00:00
beveloper
b32c90d52b fix type mismatches
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-03 01:40:34 +00:00
Axel Dörfler
e1481ffc45 Two fixes from NewOS (change 1606 & part of 1612) that made it into the
VFS.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@959 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-02 14:57:33 +00:00
Axel Dörfler
3f8b94d3cd Incorporated the change 1619 into our tree. Cleaned up the source.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@958 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-02 14:49:20 +00:00
beveloper
d703ffc09c This fixes a bad memory corrupting bug that overwrote one byte in
memomry with 0 each time a semaphore was created


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-29 00:03:45 +00:00
Michael Phipps
a608664c47 Start of work to move static variables into pages.
A little more clean up
More items on the TODO list (take one off, add 3 more).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@908 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 03:26:23 +00:00
Michael Phipps
c7b613e84e Added explicit placement new. This may be a problem in kernel land, but it
basically allows me to manage memory and still use new to setup the object.
Fixed the constructors so that objects are properly setup. Tests now run.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 01:34:19 +00:00
beveloper
c541e4ebc2 Applying the changes from BeFree.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@891 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-26 23:34:43 +00:00
Michael Phipps
afea942ffa Added pooling, removing new and delete in most cases.
pageManager still needs special treatment.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-26 20:14:54 +00:00
Michael Phipps
df6ee31838 Added reference counting to pages. Cleaned up some bugs.
More testing continues...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-26 03:12:35 +00:00
Axel Dörfler
12696848a1 Now includes StorageDefs.h to get B_FILE_NAME_LENGTH, and defines MAX_SYM_LINKS
as SYMLINKS_MAX (limits.h).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@839 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-20 11:00:54 +00:00
Axel Dörfler
544cb7d33a Added realpath.c to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-20 10:41:26 +00:00
Axel Dörfler
c071c40a72 Added the new files in libc/sys/ to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-20 02:41:43 +00:00
Andrew McCall
599a8de01a Added pwd to the Jamfiles, changed the returns to use B error codes rather
than exit()'s. Andrew McCall


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@825 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-19 13:13:25 +00:00
Andrew McCall
468048ccc3 A quick port of pwd, it compiles OK, but I haven't had chance to test it as
I am at work!

Can someone point out what I should replace err() with from err.h when its
called please! - Andrew McCall


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-19 11:31:16 +00:00
lillo
ec603fd345 forgot this
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@823 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-19 09:10:09 +00:00
lillo
615a79cc3c Implemented send_data/receive_data/has_data thread syscalls
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-19 08:28:39 +00:00
lillo
e196b7bbc5 added single-queue scheduler; the old scheduler is compiled by default - to enable the new one uncomment the #define at the beginning of thread.h
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-16 13:14:29 +00:00
Michael Phipps
53aaaf43d8 Make mmap work, more testing, fixed some bad bugs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@771 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-16 01:09:45 +00:00
Axel Dörfler
9b458ca3e7 Fixed some crashing bugs in the pci code - the kernel now boots again.
Added trace methods.
Cleaned up some code.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@759 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-14 02:09:45 +00:00
Axel Dörfler
6057f25bc6 Fixed a typo; dbg_init2() called dbg_init() instead of arch_dbg_init(), causing
many kernel debugger commands to be removed accidently...
Added a message if you entered an unknown command.
Some cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-14 00:04:59 +00:00