Commit Graph

986 Commits

Author SHA1 Message Date
Axel Dörfler
e4d36dd1f4 Implemented sigpending().
Forgot to atomically get some thread_debug_info values.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-20 17:19:46 +00:00
Axel Dörfler
50374cbdca Changed the signal handling code so that handle_signals() can be called without
having the thread lock held and interrupts disabled.
Cleaned up the signal handling code, and fixed some minor bugs with blockable
vs. non-blockable signals.
thread_debug_info was using uint64 for signals sets instead of sigset_t.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-20 16:56:04 +00:00
Axel Dörfler
7121425eb5 Turns out we could remove a mount point...
Under BeOS remove_vnode() is failing in this case, which looks like a good idea to imitate.
Also, pipefs/rootfs didn't handle that case - they even removed the entry before calling
remove_vnode() - they now behave correctly. And also BFS now returns the actual error code
received from remove_vnode() instead of B_ERROR.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-20 16:34:18 +00:00
Axel Dörfler
da6d1a7022 fs_mount_volume() now returns a dev_t as well - changed mount/mountvolume to take
that into account as well (they were reporting an error even though everything
went fine).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-20 13:03:50 +00:00
Axel Dörfler
1c88c851ad Turned off debug output again - also temporarily removed the file cache warning
about our block_io module not honouring the total length in read_pages().
Removed drops into the debugger when there is a block without an "original"
data buffer - that's completely normal and happens when someone asks for
a cleared block that is not yet in the cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-19 23:01:57 +00:00
Axel Dörfler
d7f0a6f215 If register_preloaded_module_image() fails, a warning is printed.
get_next_loaded_module_name() no longer prints anything if tracing is enabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14436 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-19 22:45:13 +00:00
Axel Dörfler
8c20600d12 Looks like some BIOS don't bother filling in cylinder/head/sectors_per_track information
for extended drive parameters.
This should fix eventual "no boot disk" messages of the boot loader.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-19 22:43:50 +00:00
Axel Dörfler
944278d7ed Fix the build - Stack.h is now gone from the BFS directory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14433 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-19 17:43:45 +00:00
Axel Dörfler
ca7c5a9e13 Implemented cache_detach_sub_transaction() - not tested yet, though.
Added and implemented new functions cache_blocks_in_[sub_]transaction().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14431 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-19 16:46:17 +00:00
Axel Dörfler
94752292dd First go at an implementation of sub transactions - code is not yet tested, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14429 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-19 14:37:29 +00:00
Axel Dörfler
0fc0129604 Fixed another stupid bug in all readv()/writev() versions: the position of
the read/write access was only correct for the first entry in the iovec.
These functions should be updated to use read_pages()/write_pages() where
possible, anyway - right now, they only save some kernel calls, while they
could be processed by the device at once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-18 19:51:47 +00:00
Axel Dörfler
28953e6c2b Fixed two stupid bugs in _kern_writev() and _kern_readv() - they accidently
tried to write from/read to the userland file descriptor instead of the one
of the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-18 19:11:07 +00:00
Axel Dörfler
3ea780cdf9 If booted from an image, the list of possible boot partitions is now ordered by
some heuristic: when you booted from a CD, CDs are preferred; else, volumes with
names like "Haiku" or "System" are preferred - if someone has better ideas, please
shout.
Note, this heuristic will only come into play if the boot loader was loaded from
an image (ie. floppy/CD/network), and you didn't choose any boot device.
Added evil methods to the Stack class that come in handy (you can now directly
access the array) for this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14410 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-18 18:45:55 +00:00
Axel Dörfler
5a54b40166 Implemented platform_add_block_devices() - if you have more than one bootable
Haiku disk installed, you can now choose between them in the boot loader.
Also fixed build - obviously forgot to compile before a last minute change...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 14:20:41 +00:00
Axel Dörfler
2db3fced5f Moved vfs_bootstrap_file_systems() and vfs_mount_boot_file_system() out of vfs.cpp
and into its own file vfs_boot.cpp.

Added basic support for booting from CD - it doesn't give CDs a higher priority,
so you could end up booting from HD when you didn't explicetly select "CD-ROM"
in the boot loader. Eventually, it should only boot from HD in this case, if
booting from CD failed (because of a missing boot partition or whatever).

fs_mount(), _kern_mount(), and _user_mount() will now return the dev_t of the
mounted device, and not just B_OK. Maybe we should have fs_unmount() work on
a dev_t instead of a path as well...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 14:01:04 +00:00
Axel Dörfler
94caf40a8e Enlarged the buffer size to the standard CD block size - this greatly speeds up
the boot process. Will experiment with larger sizes later (24k is the current
limit, due to the memory layout used by the platform dependent code).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 13:52:18 +00:00
Axel Dörfler
597416d1dd gKernelArgs.boot_disk.cd is now only set to true, if the selected boot volume
is still the CD-ROM.
BIOSDrive::ReadAt() now tries to read a specific block up to 3 times before
failing - after the second retry, it will also reset the disk system.
get_ext_drive_parameters() will now fail if the BIOS fills in the device_parameters
structure incorrectly (just tested some values against zero, that at least helps
in the case of one of my systems).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14401 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 13:45:55 +00:00
Axel Dörfler
e84506daca The home/end keys are no longer able to select disabled entries.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 13:40:57 +00:00
Axel Dörfler
76a377394e arch_debug_console_init() is called with args == NULL in case of an early
boot message - unfortunately, it crashed when used this way until now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 10:15:42 +00:00
Axel Dörfler
19567a9917 Now makes sure the selected entry is visible upon entry, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14398 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 10:09:04 +00:00
Axel Dörfler
a51b55c985 "kernel_args.boot_disk.cd" was never set to true...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 10:06:28 +00:00
Axel Dörfler
df13a980fe Mixed up concepts of a selected and a marked item - the Menu::ChoiceText() is now
set correctly (it behaved a bit fuzzy before).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-17 10:05:39 +00:00
Axel Dörfler
2e2bd87511 Renamed devices_check_boot_cd() to check_boot_cd() and moved it up to the other BIOS
functions - it no longer terminates the CD-ROM emulation, but only checks the status,
and therefore, it's now called by platform_register_boot_device() instead of from
platform_start_kernel().
This also makes the devices.h header useless.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14390 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 21:38:12 +00:00
Axel Dörfler
51e081bade Removed platform_boot_device_is_image() - platform_get_boot_device() now fills
in the adequate field in the kernel_args structure.
Renamed gCDFloppyBoot variable to gBootedFromImage (as network boot should look
similar).
The "kernel_args.boot_disk.cd" field is now maintained as well.
The print_item_at() menu function now prints the Menu::ChoiceText() instead
of that of its marked item.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 21:26:30 +00:00
Axel Dörfler
5ea23bb0a3 Removed platform_boot_device_is_image() again; it's now replaced by a field
"booted_from_image" in the kernel_args' boot_disk structure.
Also, added fields "cd" and "user_selected".
A CHOICE_MENU menu can now have a choice text - this is automatically updated
as entries in the menu get selected.
The boot volume menu now has the initial choice text "CD-ROM or hard drive"
in case the boot loader was loaded from an image. The "Rescan volumes" item
is no longer selected by default (only if there was no boot volume found) - but
it's still functionless anyway.
The TAR fs will now appear as "Boot from CD-ROM" in the boot volume menu.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 21:22:19 +00:00
Axel Dörfler
d32f04d20a Improved comments about the manual symbol relocations.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14382 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 11:49:35 +00:00
Axel Dörfler
8423f6f478 Instead of blindly trying to load BFS when booted from a boot image, the
loader will now respect the selection made by the boot image creator, and
just load every file system there is on that image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 11:39:07 +00:00
Axel Dörfler
e3fcb58ebb The boot loader now has special support for being booted from a boot image
like floppy or CD boot.
This allows it to reduce the number of scans needed to identify the boot
partition - when booted from a real floppy, this speeds up the boot
process by a magnitude.
Also, the loader now has a fall back in case there were no "boot" links
on the disk - the current boot floppy script doesn't create them.
With these changes, I was able to boot into a HD based Haiku installation
from a floppy disk. It's not yet enough to boot from CD (as the boot
device selection is a bit too simplistic right now), but it will eventually
come next. Testing is a lot slower here, though, as neither qemu nor
Bochs support multi-session CDs (at least I have no idea how to get them
to do this).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 11:34:18 +00:00
Axel Dörfler
313ffb09da Improved debugging output a bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14379 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 11:20:42 +00:00
Axel Dörfler
ceb769360d Got rid of the now unused sPageTable variable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14378 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 09:26:11 +00:00
Axel Dörfler
7416092b83 Marcus spotted an error in the cylinder calculation in get_drive_parameters() - didn't
have an effect on floppies or CD-ROMs, but would have on real hard drives that require
CHS access.
Changed the cylinder-to-regs conversion in BIOSDrive::ReadAt() (that one was actually
correct) to make it look similar to the conversion in the opposite direction in
get_drive_parameters().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14377 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 09:25:45 +00:00
Axel Dörfler
b093987a7b tarfs is now maintaining a node ID and got all methods that its entries are statable.
Renamed TarFS::Node to TarFS::File to correctly name the class hierarchy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14376 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-14 09:23:00 +00:00
Axel Dörfler
0ecc530bf0 TAR fs is now also working correctly in the real boot loader.
Some more cleanup and better error output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-13 14:06:11 +00:00
Axel Dörfler
8d156f1c5e Fixed a bug with the offset handling in BIOSDrive::ReadAt().
Implemented CHS support needed for smaller hard drives, CD-ROM, ...
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14369 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-13 13:45:23 +00:00
Axel Dörfler
e83ba2ee32 Enlarged the boot loader's heap area to 64kB needed for the tarfs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14368 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-13 13:43:13 +00:00
Axel Dörfler
4cc5dde4a7 Updated memory layout comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14367 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-13 13:40:58 +00:00
Axel Dörfler
0eecdd8334 Made the page table allocation/filling mechanism a bit more flexible and less error prone.
Also, freeing regions is now supported (but still only the last allocated region can be
freed, as that's currently good enough).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14366 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-13 13:37:18 +00:00
Jérôme Duval
a26988784a added _fseek for R5 compatibility
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14365 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-12 15:52:35 +00:00
Jérôme Duval
42848b0907 added index and rindex to libroot.so
R5 ftp and telnet commands now run on Haiku


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-12 13:05:03 +00:00
Axel Dörfler
83333bf237 Missed those with the previous commit: added tarfs to the boot loader build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14345 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-11 01:17:48 +00:00
Axel Dörfler
0428a0ddc4 Now loads the maximum size of zbeos when booted from a floppy or CD.
Note, this value should be patched by the build system to the actual size
of zbeos - but since we don't have this mechanism in place yet, the maximum
value is probably the best default, even if it should slow down a floppy
boot considerably.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14344 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-11 00:21:37 +00:00
Axel Dörfler
85a53ea280 The boot loader now has tarfs support needed for booting from CD-ROM.
It expects the zipped TAR at offset 192 kB on the boot image.
This work was mostly done by Ingo during BeGeistert.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14343 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-11 00:17:59 +00:00
Axel Dörfler
eddf43dd76 Added missing clock() function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 17:33:10 +00:00
Axel Dörfler
9a63d90397 Added kernel private VFS functions vfs_entry_ref_to_vnode() and vfs_vnode_to_node_ref().
Minor cleanup of vfs.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 09:26:27 +00:00
Axel Dörfler
681779f1c8 Our close-on-exec flag handling was broken: it's supposed to be specified per slot, not
per file descriptor (a descriptor can be shared among several slots). There is now a
second table in the io_context structure that contains that information in a bitmap.
There are now two new (private) functions to control the close-on-exec flag, fd_close_on_exec(),
and fd_set_close_on_exec().
F_DUPFD, dup(), and dup2() are supposed to clear the close-on-exec flag on the duplicated
slot - this fixes bug #57 (no output after a redirect of a shell builtin).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14313 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 09:02:59 +00:00
Axel Dörfler
e90c3fec10 dup2() didn't close the evicted file descriptor (ie. call its close hook) - it just
removed it.
Added comment why there is an explicit dup2() at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 08:55:19 +00:00
Axel Dörfler
1670b8f596 num_used_fds counting was broken for dup2() and vfs_new_io_context() when it was
used with a parent context.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 08:53:17 +00:00
Axel Dörfler
e8d4a05d8b Renamed the "iocontext" command to "io_context" to match the structure name.
It now also accepts a team ID and will then dump its io_context.
Accidently mixed used/max FD counter.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14310 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 08:47:03 +00:00
Axel Dörfler
9e3ebf4033 exit_thread() no longer sends a signal when it's called from a kernel thread - instead,
it will exit directly to have the same behaviour as in user space (where it doesn't
return to the caller, since signals are handled before returning to user space).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 08:43:10 +00:00
Axel Dörfler
8d3256a4ad The "thread" debugger command now also accepts an address for the thread structure.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 08:40:35 +00:00
Axel Dörfler
7dc1c65f2f Improved "team" debugger command: it will no longer crash on the kernel team, it
will no longer use vm_get_kernel_aspace() (which acquired a semaphore) and it now
accepts decimal team IDs as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 08:36:37 +00:00
Axel Dörfler
759a38d144 load_kernel_add_on() leaked FDs in case the image was already loaded.
And that was causing bug #50 (which is fixed now).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14305 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-05 16:41:04 +00:00
Axel Dörfler
333735e881 Added a new debugger command "iocontext" that prints out info about the kernel's
I/O context (or a specified one) including its FDs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-05 16:39:45 +00:00
Axel Dörfler
08da6fccdd Introduced a sane concept of ownership for the team_args structure: now load_image_etc()
and exec_team() have an additional "kernel" argument and will copy the arguments
themselves (or rather, delegate that to create_team_arg()).
When team_create_thread_start() is called, it will take over ownership and is
responsible for deleting it - this also fixed a memory leak in case the user
stack area couldn't be created.
Also changed comment after exit_thread(): since this call only delivers a signal, the
code after it will still get executed.
This fixes the crashing symptom of bug #50.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14303 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-05 15:32:48 +00:00
Axel Dörfler
f10cba9aec Changed get_mount() to return a status code instead of just the mount or NULL.
Some fields of fs_mount were not properly initialized when FS's mount function
was called, and therefore, could let get_mount() return a mount structure that
was not yet read for public consumption (this should fix bug #51).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14223 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-22 17:45:43 +00:00
Axel Dörfler
d86d4063b0 thread_create_thread_start() is a thread_func and therefore returns int32 not status_t
(that's what our headers say).
Some style fixes in signal.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14192 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-16 12:52:59 +00:00
Jérôme Duval
ab38c90461 added a libroot sigpending, kernel support isn't implemented
(fixed partly bug #49)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-13 16:12:20 +00:00
Jérôme Duval
3f84430938 added a trace and changed err type in team_create_thread_start()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14180 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-13 15:44:30 +00:00
Jérôme Duval
04b831a692 added pause() (kernel support is lacking though)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14130 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-08 13:06:49 +00:00
Jérôme Duval
96e6579454 added a libroot sigsuspend, kernel support isn't implemented
(fixed partly bug #48)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14129 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-08 12:26:16 +00:00
Jérôme Duval
e96ac99568 improves style
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-05 18:01:48 +00:00
Jérôme Duval
e5ee1dad6a added sigaddset, sigismember, sigdelset to libroot.so from inline versions in signal.h
moved static inline to extern inline to allow this change
please someone review this (ie are they platform dependent functions ?)
should fix bug #47


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-09-02 11:53:43 +00:00
Axel Dörfler
47a54bea53 Rootfs now starts with 1 for the first inode ID.
Instead of -1, vnode_path_to_vnode() now returns the ID of the starting vnode when it
doesn't need to traverse the path at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14081 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-28 20:08:32 +00:00
Axel Dörfler
b3373253a4 The generic syscall now returns more correct status codes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14078 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-28 14:10:12 +00:00
Axel Dörfler
43ffbcc46e If a page fault happens from within the kernel debugger, vm_page_fault() is no
longer called - instead, it get its own mini page fault handler: if the thread
has a fault handler, that one will be executed.
Exiting the debugger (with the "continue" command) no longer causes the
vm_page_fault() routine to be called if interrupts were disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14070 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-26 02:43:15 +00:00
Axel Dörfler
29cf7df355 kernel_debugger_loop() now memorizes the last sDebuggerOnCPU value, so that
the CPU value doesn't get lost when exiting a nested debugger.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14069 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-26 02:39:24 +00:00
Axel Dörfler
e432cef296 Updated a few more hash functions to be able to deal with negative numbers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-26 02:07:41 +00:00
Axel Dörfler
f26e4a1c98 Made hash functions able to deal with keys with negative numbers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-26 02:02:33 +00:00
Axel Dörfler
7b285866ff Fixed hash functions: when the key was lower than 0 (could happen with entry_refs
and node_refs passed in) they returned an invalid index (larger than range).
Fixed rootfs compilation with tracing turned on.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14065 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-26 02:01:21 +00:00
Axel Dörfler
19dfa58852 add_wall() first added the memory block to the list, and then added the wall - there
was a race condition between that and the wall checker daemon (if enabled): it could
occasionally report an overwritten wall in that very moment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14051 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-22 21:01:03 +00:00
Axel Dörfler
5793da1edc Renamed elf_lookup_symbol_address() to elf_debug_lookup_symbol_address() and
removed the locking it did, as that doesn't work anymore in the kernel debugger.
The function was not thought to be used outside the debugger, anyway.
Improved usage message from debugger command "ls".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-22 20:35:42 +00:00
Axel Dörfler
c2ee3ca134 Added a comment on how to deal with directly writable memory mapped files.
There, we need to detect the modified state from the mapping, too - the
vm_page state itself might not be up to date.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14049 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-22 20:33:19 +00:00
Axel Dörfler
4784eca19d cache_io() did not set the state of a page to PAGE_STATE_MODIFIED when it wrote
to it - if that page was read from disk unmodified before (or written back in
the mean time), the updated contents coult not be detected, and therefore, were
never written back.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14048 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-22 20:31:32 +00:00
Axel Dörfler
61a1551551 Added empty function stubs for __fpclassify[fl](); they currently pretend that every number
is a normal one - maybe someone finds the time to implement them for real before I do :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-22 01:34:32 +00:00
Axel Dörfler
67a7102658 Fixed a pretty fatal bug in the page fault handling: interrupts were enabled
even if "kernel_startup" was "true". Page faults are now no longer allowed
during kernel startup (and could be easily avoided). The only situation where
we accept page faults with interrupts turned off now is during a kernel debugger
session.
Added a command debug_debugger_running() to test for that situation.
kernel_debugger() no longer sets kernel_startup while it's running; there should
be no situation when this could be helpful.
Interrupts are no longer enabled when a page fault happens in the kernel
debugger.
This potentially fixes all sorts of problems, and not only in the kernel debugger,
it could also have affected SMP (will test later).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14045 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 23:27:51 +00:00
Axel Dörfler
8a4462f51c Turned off debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 23:19:39 +00:00
Axel Dörfler
96643545c5 Removed unnecessary and stupid code - the doubled chain allocation also caused
a page fault during startup, because the chain memory is B_NO_LOCK.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 23:18:43 +00:00
Axel Dörfler
099ceb8f9d map_physical_memory() and its backend vm_map_physical_memory() did not map in the
pages, ie. they considered the areas to be B_LAZY_LOCK. But that doesn't really make
sense and potentially cause page faults where you wouldn't expect them (and where
it's not a good idea to trigger them).
Reworked display_mem() (used by the dw/db/ds commands in the kernel debugger) to
be a bit more sane, improved formatting, and allows it to work on non-existing
memory without a panic.
The "area" debugger command now also accepts an address (contained by the area)
as argument - and it will now always print out an error message if no matching
area could be found.
Replaced all dprintf() calls to kprintf() calls for the kernel debugger functions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14042 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 23:17:09 +00:00
Axel Dörfler
72a263b6cf Make sure only ASCII characters are rendered.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14039 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 15:09:43 +00:00
Axel Dörfler
e0481f928e Now marks a partition unmounted on unmount - that allows a volume to be remounted as often as you like.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14036 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 13:45:15 +00:00
Axel Dörfler
23e13b2e9b The number of semaphores available is now computed based on the amount of memory.
Just like on BeOS, the overall maximum is 65536 semaphores for now - the mechanism
tends to make more semaphores available than the one under BeOS, though (which is
intended).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 12:20:43 +00:00
Axel Dörfler
30616a3243 block_cache::Free() now accepts NULL pointers (it was already used this way before...).
Unmounting BFS volumes should now work as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14034 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 11:57:36 +00:00
Marcus Overhagen
cc33b4a1ca This adds the required functions to libroot.so and fixes DEBUG build.
Unfortunately, they are pretty broken, so I added them into floatmath.c


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14019 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 01:30:46 +00:00
Axel Dörfler
5b14757a30 We now have a consistent scheme what the file system should do with its root
node: like in BeOS, it *must* own the root node (ie. via publish_vnode()),
unlike in BeOS, it must also drop that reference on unmount (symmetrical
behaviour definitely makes more sense to me than the Be way).
Since all existing file systems for Haiku behaved differently, I brought them
in line (only pipefs already adhered to that new standard for some reason,
rootfs did only released the node, devfs did nothing - despite it's probably
not really useful to be able to unmount them).
fs_mount() will now panic if a file system does not do this correctly (useful
for file system developing).
Unmounting is now theoretically working again: when trying to unmount a BFS
volume, the kernel crashes in the block cache destruction... (but that's work
for tomorrow).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14017 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-21 00:41:16 +00:00
Marcus Overhagen
794df3bf25 This removes the inline assembly code for find_thread
from OS.h, sorry for triggering a complete rebuild.
To avoid doing a syscall for find_thread(0), the assembly
version is now in libroot. For BeOS R5 compatibility, 
_kfind_thread_ is retained. This will fix some compile 
problems, and provides a cleaner OS.h for future Haiku
versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 23:57:11 +00:00
Axel Dörfler
e6b682541e Fixed a stupid bug in the recently updated write_chunk_to_cache(): lastPageOffset
was incorrectly calculated, and could therefore cause all sorts of troubles with
writes over 4 kB.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 23:22:13 +00:00
Axel Dörfler
99e1c71ee6 - fixed a locking bug in the file cache: get_file_map() could been called with either
only a read lock on the inode, or without a lock at all (in case of prefetching) - it
  is now using the cache_ref's lock to make sure it's retrieved only once and doesn't
  waste/corrupts any memory.
- since that fix made it mandatory to fix write_chunk_into_cache() to not call pages_io()
  while holding the cache_ref's lock (was a to-do item before), I changed it to make
  that possible.
- It now also supports write-through caches in theory - as there is no way yet to tell
  a cache to work this way.
- Optimized for the not so uncommon case of writing the last part of a file that is not
  a multiple of the page size - it won't call pages_io() anymore then, but zero the rest
  of the page directly.
- vm_page_write_modified() is now calling write_page() without holding the cache_ref's
  lock as well.
The updated write_chunk_to_cache() is not so well tested, though, but appears to work
so far.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 21:32:31 +00:00
Axel Dörfler
07810890b5 Entering an empty line to the debugger will no longer match the first best command
available.
Broken escape sequences are now properly ignored (read one character too much before).
Since the current line buffer is part of the history, we now delete that buffer when
crossing the current line again while traversing the history (restoring the former
buffer would be the nicest way, but that would require another empty buffer and more
copying).
Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 21:24:13 +00:00
Axel Dörfler
70c3e1a42c The escape sequence for erasing lines is now also supported (it's used by KDL command history).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 20:55:02 +00:00
Axel Dörfler
ed73e0eefa arch_debug_blue_screen_getchar() can now also return escape sequences for cursor
movement - IOW, the history of kernel debugger calls is now working also from
the on-screen KDL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 20:53:44 +00:00
Axel Dörfler
a10cd10b2b Fixed a hypothetical bug: switch_sem_etc() was using thread_get_current_thread()
in an error message without checking for a NULL pointer (which happens during
early boot, and even though it would be impossible to get there at that time,
it shouldn't be accidently copied to anywhere else this way).
Added a compile time option to monitor the last thread that successfully
acquired a semaphore (disabled, though, only enable it when needed).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 20:13:05 +00:00
Axel Dörfler
61aceefd6e The debugger command "waiting" now also accepts a semaphore as argument (specified by ID),
and will only list those threads waiting for that one if used that way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-20 15:57:56 +00:00
Jérôme Duval
16c05905ae forgot this one
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-19 15:24:08 +00:00
Jérôme Duval
19664a737a added UFC crypt library (LGPL)
provides crypt() to libroot, untested


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-19 15:17:43 +00:00
Axel Dörfler
d6c32d2bf3 The debugger's "sc"/"where" command now accepts a thread ID as parameter (and
then shows the stack crawl of that stack instead of the current one).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-19 12:53:58 +00:00
Axel Dörfler
c987e126de Testing against IS_KERNEL_ADDRESS() is more correct.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-19 12:52:19 +00:00
Axel Dörfler
851028d043 Fixed a warning I accidently introduced with the last change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-18 23:33:54 +00:00
Axel Dörfler
cd661dfcf8 Now dumps all semaphores matching the name you are searching for, not only the first one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-18 15:13:03 +00:00
Axel Dörfler
f79ba0f9ba Now always prints out a message if the searched sem could not be found, and not
only under certain conditions.
Now also accepts decimal numbers as IDs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-18 15:11:18 +00:00
Axel Dörfler
e5c0e4a655 Now prints an error if no thread matching the requested criteria could be found.
Simplified parsing the ID (no need to differentiate between hex and decimal, if
we do both anyway).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-18 15:09:30 +00:00
Axel Dörfler
e8e4accd16 Add some useful debugger commands to the VFS layer for dumping a vnode, an fs_mount, and
the mounts/vnodes list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13971 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-18 15:07:38 +00:00
Axel Dörfler
5913a657df Added two possible "ToDo" comments.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13970 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-18 12:41:18 +00:00
Axel Dörfler
b96ea69c37 You really can do the same mistake twice, even in two subsequent lines of code...
get_file_map() now seems to work correctly in all regular cases.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-13 12:37:13 +00:00
Axel Dörfler
90f1dccb72 Our ELF loader now gets something like error handling - it may still have some
(memory) holes, but failing to load an add-on should no longer exit your
application. Reported by Korli.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-12 20:52:46 +00:00
Axel Dörfler
4430d71191 Better error checking (at least panic if something goes wrong, instead of ignoring).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-12 19:51:17 +00:00
Axel Dörfler
139353cf1a Fixed two bugs in the new file extent caching code:
- under certain situations, the wrong extent could be chosen (off-by-one error)
- the resulting length of the first vector was incorrectly calculated for all
  extents but the first
Improved error checking a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-12 19:50:42 +00:00
Axel Dörfler
13d77a4cde Now fills in the machine field with something more appropriate (currently mimics
BeOS behaviour). Maybe we want to have some different values here later on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-09 22:58:58 +00:00
Axel Dörfler
7964c56d67 Added vfs_get_cwd() call to get the mount_id and vnode_id of the current
working directory (instead of the full path).
Cleanup of some remaining "int" status variables (where it should have
been a "status_t").


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-09 16:25:01 +00:00
Axel Dörfler
8733b7318d The stack trace in the kernel debugger is now safe against accessing invalid
user memory (it got its own fault handler). IOW the stack frame is not changed
in that case anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-09 16:09:26 +00:00
Axel Dörfler
eab435cd59 vfs_get_vnode_cache() now only allocates a new cache if requested: this
prevents the system to allocate caches for files that don't use or have
a file cache (ie. only those can be mmap()ed!).
Therefore, cache_prefetch() no longer crashes when trying to prefetch
files without a file cache.
read_into_cache() no longer does anything if the requested size is 0.
Fixed a bug in cache_prefetch_vnode(): if the cache couldn't be retrieved,
it put the vnode, but didn't own it (the caller does).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13904 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-05 11:52:22 +00:00
Axel Dörfler
06ae92cd04 Maybe it's better to free the team resources after notifying the watchers;
since the hooks are called in the context of the team.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-05 10:27:08 +00:00
Ingo Weinhold
7d11acca6d Spotted by Axel: If the caller of a load_image_etc() was waiting for the new team to be loaded, but the team died before finishing loading we were notifying the caller only in case the team had already more than one thread.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13900 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-04 22:45:04 +00:00
Axel Dörfler
67f207164b Copied some code from the console driver: we now understand cursor movements,
and even color changes :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-04 14:55:11 +00:00
Axel Dörfler
95839f5c92 The file cache now has another init method that is called after the boot
device becomes available.
Currently, it opens the "launch_speedup" module (if available), later it
should consult a settings file for what to do.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 17:25:03 +00:00
Axel Dörfler
0d299e8a4b The team watching mechanism now works as intended.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13892 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 16:57:40 +00:00
Axel Dörfler
5159717538 team_delete_team() should have called delete_team_struct() instead of just
freeing the team - it leaked dead children semaphores and death entries;
waiting for a specific team could not have worked before.
Fixed delete_team_struct(), it did not correctly free the death list (would
have accessed freed memory).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 12:42:01 +00:00
Axel Dörfler
99c566f6c9 Added a team watching mechanism in the kernel, not yet tested (but at least doesn't cause any harm yet :-)).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-03 12:00:42 +00:00
Axel Dörfler
3798d46911 Calmed down start up a tiny bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:43:30 +00:00
Axel Dörfler
8fef8adb6e Replaced all dprintf() calls from the kernel debugger with kprintf() calls.
(there might be some more left, but it's not urgent or fatal)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:28:20 +00:00
Axel Dörfler
8b45467cd0 Added debug commands "ready", "running", and "waiting" that only list those
threads which are doing said thing.
Replaced all dprintf() calls from the kernel debugger with kprintf() calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13883 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:27:00 +00:00
Axel Dörfler
ed65cbe349 The kernel debugger no longer uses dprintf() but kprintf() when printing
(dprintf() locks using acquire_spinlock() which can itself drop into the
kernel debugger, causing an endless loop (until the stack was full).
Removed debug_putchar().
The gdb interface is now calling arch_debug_serial_*() directly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:25:27 +00:00
Axel Dörfler
0a51327f98 Fixed on-screen KDL keyboard input routine: it now works much more reliable
and ignores keyboard input. Also, it now uses the definitions from the PS/2
HID driver (from ps2.h).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 16:19:36 +00:00
Axel Dörfler
c50cfe23dd Fixed crashing bug in remove_vnode(): it freed the vnode, but it didn't
remove it from the hash, and thus, left a dead pointer around.
free_vnode() does now also remove the vnode from the hash - this is done
so that the file system is notified about removal/put of the vnode before
there is a chance that this vnode is recreated/reloaded (could make the
life of file system writers a bit easier).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13877 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-02 11:20:04 +00:00
Axel Dörfler
11a3346caa The file extent map is now cached as well. Code is not optimal yet, and almost not
tested for fragmented files - but it seems to work good enough for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 22:34:02 +00:00
Axel Dörfler
b72cf2601f Renamed vfs_vnode_acquire_ref() to vnode_acquire_vnode().
Removed vfs_vnode_release_ref(), as vfs_put_vnode() already does the same thing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:32:23 +00:00
Axel Dörfler
186857529e cache_prefetch() now comes in two flavours: one with a direct vnode pointer,
the other one with usual device/inode ID pair.
Both versions now accept an offset/size pair to specify the region of the
file to be prefetched - this may be turned into a file_vec_io array later on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13866 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:24:58 +00:00
Axel Dörfler
b7d8ef5a0d The term vnode_ptr is not used anywhere else; renamed vfs_put_vnode_ptr() to vfs_put_vnode().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:17:41 +00:00
Axel Dörfler
9882caaadd The path resolving functions can now also fill in the ID of the parent directory.
This is currently only used for the file cache module API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 12:44:59 +00:00
Ingo Weinhold
d35f0da76d Aesthetical change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13854 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-29 13:15:39 +00:00
Philippe Houdoin
685645f9bc USER == ! _KERNEL_MODE, right (!?).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13845 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-28 23:25:41 +00:00
Axel Dörfler
da1f176a9a You can no longer write to O_RDONLY streams, and you can no longer read from O_WRONLY streams (thanks to Ingo for this hint).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-22 06:54:19 +00:00
Ingo Weinhold
7f53c2cc96 We now make sure, that images always have absolute paths, otherwise
their path could be invalid in other contexts (e.g. the debug server might
be unabled to find them). This seems to be what BeOS does, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13796 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-21 23:51:02 +00:00
Ingo Weinhold
d08379a80b * Now we deal with all x86 exceptions, i.e. we no longer panic() when a
user application performs a division by zero or causes a general
  protection fault. For some exceptions (e.g. machine check) I wasn't
  quite sure whether they can be caused by user apps at all, so we panic()
  in those cases. Wouldn't harm, if someone more knowledgable would check
  this, though.
* Removed the unused fault handling stuff, respectively moved the little
  that was used into x86/arch_int.c.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13795 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-21 23:47:08 +00:00
Axel Dörfler
f4a8c33b5c Fixed a bug in put_death_stack_and_reschedule(): release_sem_etc() was called
with the thread lock held, which might have caused a panic later on, if there
was another thread waiting for the death stack semaphore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13769 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-19 18:10:12 +00:00
Axel Dörfler
230a037ed4 Fixed a bad bug in vm_copy_on_write_area(): the area's cache offset was not taken
into account when remapping the pages read-only; it could have overwritten valid
page mappings this way. This was also the reason for the Terminal to crash - it
does now work as it should, although some keys don't work (like tab completion)).
vm_copy_area() no longer always sets B_KERNEL_WRITE_AREA if no kernel protection
was specified, but mirrors the userland protection (for example, the x86 MMU is
not able to have a page writable in kernel but not in userland). This caused
some areas to be read/write when read-only would have been enough.
vm_copy_area() now panics when vm_copy_on_write_area() fails - that's of course
no real solution, but it's bettern than letting it silently fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-19 18:00:31 +00:00
Axel Dörfler
a00d33c094 No longer reboots when a shutdown was requested - this gives the registrar
the opportunity to show the "System is now ready to reboot" alert.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-17 13:28:11 +00:00
Axel Dörfler
09105be0f8 Now uses the TO_PAGE_SIZE() macro already defined to round the debug area to a page size multiple.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-17 12:54:41 +00:00
Ingo Weinhold
aeaa4a21a4 It's considered rude to try killing the kernel team.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-16 23:38:07 +00:00
Ingo Weinhold
28e0d4cd19 The runtime loader now creates a debug area through which other teams can
access a team's internal loader data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-16 21:07:17 +00:00
Ingo Weinhold
d3bdf71ea6 The debug nub port of a debugged team is owned by the debugger. Hence we
need to transfer the ownership, when handing over the team to another
debugger.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-16 21:04:22 +00:00
Ingo Weinhold
7f9c673981 * Introduced a new debugger message B_DEBUGGER_MESSAGE_HANDED_OVER, which
is sent to a debugger when the debugged team has been successfully handed
  over to another debugger.
* Fixed handling of B_DEBUG_MESSAGE_PREPARE_HANDOVER. We don't send a reply.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-15 12:18:33 +00:00
Axel Dörfler
31a5ff5d8e We now have a (private) writev_port_etc() call. This could be used to avoid
allocating a buffer and copying your data into it, when you have data to
send in several chunks (for example, this could be used by BMessage, as
suggested by Ingo Weinhold).
Code is untested, but should work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-13 23:55:15 +00:00
Axel Dörfler
d7013609a8 Fixed a big memory leak: _user_writev() and _user_readv() allocated
a new iovec array, but only freed them on (early) error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13666 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-13 23:43:05 +00:00
Axel Dörfler
c9955bf00a Added new but empty function file_cache_invalidate_file_map().
This is needed in case the on-disk representation of a file changes (due to reorganization/defragmentation).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-13 16:33:05 +00:00
Axel Dörfler
54476a21b5 file_create() now also supports FD relative path specifications.
This was the cause for some apps to put their settings files to the current
directory, and also that Tracker did not find some icons (from the icons
it installed in the MIME database).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-12 16:33:10 +00:00
Jérôme Duval
b1c123994c Updated to tzcode2005j.tar.gz
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13561 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-08 23:49:29 +00:00
Ingo Weinhold
a406236dc2 New error codes:
- B_SHUTDOWN_CANCELLED: The shutdown process was cancelled (most likely by
  the user).
- B_SHUTTING_DOWN: An operation cannot be performed, since the system is
  shutting down (e.g. BApplication creation).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-03 16:50:29 +00:00
Axel Dörfler
0160c6fbda Fixed minor drawing problem of the on-screen KDL: in NO_CLEAN mode, the first two
lines would be left untouched instead of cleared before use.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13375 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-01 06:42:07 +00:00
Axel Dörfler
b7a96f02fd Now fills in system_info::cpu_infos[] (ie. CPU activity) by looking at the active
time of the idle thread. IOW Pulse now works :-)
Renamed the idle thread/stack to start with 1 instead of 0 (first idle thread will
be called "idle thread 1").
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13373 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-01 00:31:38 +00:00
Axel Dörfler
e970b839a0 Disabled B_USER_CLONEABLE_AREA for now - maybe this should be handled via kernel settings later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13372 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-30 23:14:13 +00:00
Michael Lotz
06500c3e58 The color index is multiplied by 3 because there are R, G and B values for each color in the palette. But uint8 can't hold these for any index above 256/3 obviously. Also fixed the 24-bit display. It works on real hardware but looks broken with bochs. I suppose bochs does not handle 24-bit VESA correctly though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-29 23:40:25 +00:00
Ingo Weinhold
07b6630b86 Made reading and writing memory overflow safe.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13306 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-28 11:19:30 +00:00
Ingo Weinhold
047ab3f955 Be on the safe side when checking the size of data to be written to an area (overflow).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-28 00:35:28 +00:00
Jérôme Duval
9d69de4c3d inline functions aren't inlined when we have -g / -O0
we filter them for this directory
hopefully this fixes Darkwyrm's build problem


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-15 15:02:06 +00:00
Axel Dörfler
e7281ecba6 Fixed a bug in next_argument(): it could read after the terminating
null byte, and add junk as arguments. Thanks to Korli for testing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 23:40:43 +00:00
Axel Dörfler
43ed6aa0db The "shebang" handler is supposed to parse arguments, too - we now do that.
Also, when the line is too long, E2BIG is returned.
Thanks to Korli who pointed me to this: http://homepages.cwi.nl/~aeb/std/shebang/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 12:39:06 +00:00
Axel Dörfler
be22452f3b Apparently, both load_image() and exec*() support running scripts. We do that
now as well.
Also, both functions will now test if the executable exists and is valid; that
way, load_image()/exec*() can catch many errors without having to create a new
team (or erase the current one - an exec*("my invalid app") might now return
with an error).
The runtime linker now exports a function to test executables that is aware
of the search paths, and will also check user permissions upfront.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 11:23:29 +00:00
Axel Dörfler
229b2db028 cache_node_launched() is now called later, so that the environment will
be the same for both ways (via load_image() and exec*()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13112 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 11:15:05 +00:00
Jérôme Duval
adf47eb76d we mimic R5 : getgroups return 0
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-14 00:08:21 +00:00
Axel Dörfler
b84688be5f Added a basic low memory handler service.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 13:03:54 +00:00
Axel Dörfler
b1a248305b Minor cleanup, changed return type of page count functions (from addr_t to size_t,
as that's more correct).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13089 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 13:02:24 +00:00
Axel Dörfler
a69e0ac327 The boot item list was not initialized; this was no problem, though, as
no items can be removed from that list - nevertheless, it's wrong.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13088 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 13:01:13 +00:00
Axel Dörfler
ff9fb62471 Some cleanup (made static variables static).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13087 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-13 12:59:11 +00:00
Axel Dörfler
183dee22cb Unlike R5, receive_data() could return an error code under Haiku - this
can now only happen if the thread is killed.
_user_receive_data() will now longer pass B_CAN_INTERRUPT to receive_data(),
but B_KILL_CAN_INTERRUPT - this should fix the problem Stefano experienced
with this function, even if I couldn't reproduce it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-12 11:14:37 +00:00
Axel Dörfler
2a1492f0fa Moved the definition of the BlockAddressPool class into block_allocator.cpp, as it's
not used outside of it.
Added tracking for the last transaction in the block cache; that way it can test
if the last transaction has been closed before opening a new one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13022 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-09 02:14:28 +00:00
Axel Dörfler
584d673049 Fixed various bugs in the block allocator: new free ranges were never added
to the free list, so a new range was started for every allocation (!).
block_range::Free() did not update the chunk's used_mask correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-09 02:09:06 +00:00
Axel Dörfler
78d6683c68 Changed the "help" command to be able to only show all commands starting with a certain string.
This helps to reduce the flood of commands for those blue screen "users" :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-08 17:16:40 +00:00
Axel Dörfler
68c1f3d2eb Disabled code that could find newly installed drivers - it's not likely we
will do that anytime soon, and it should be done by using node monitoring,
anyway.
devfs_open_dir() now makes sure the directory contents are up-to-date - this
should fix the app_server device lookup.
Disabled debug output in the read/write hooks to improve its usage.
Renamed part_map to partition.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-03 00:51:17 +00:00
Axel Dörfler
80f6ef8bd8 Moved load_driver() and load_driver_symbols() over to devfs.
Added new devfs_add_driver() function that the device manager will now call
to register new drivers.
Devfs will now keep a list of known drivers and remembers, if they have
been initialized already - a driver can now safely scan the directory it's
in while being scanned itself without having its hooks called twice.
Devfs is now using a recursive lock instead of a mutex (that's not really
a requirement right now, but would allow us to keep the fs lock during
scanning).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-02 18:32:21 +00:00
Axel Dörfler
19b77242ac Some minor cleanup: removed unneeded includes, updated introducing comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12932 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-02 18:23:26 +00:00
Michael Lotz
128e8d23fa Add more missing float math (modf and modff).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-01 20:03:12 +00:00
Axel Dörfler
317121e102 Work in progress of the new block allocator for the block cache. It works, but
currently needs even more memory than the old one 8-)
Not cleaned up at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-01 16:39:38 +00:00
Axel Dörfler
12e1714d54 Fixed stupid bug in copy_environ_to_heap_if_needed(): it copied the
environment, but it didn't set the "environ" to the new array, and
thus throwing away the copy again.
GCC no longer crashes because of this, and runs through without help :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-31 01:59:01 +00:00
Axel Dörfler
dde78a340e Fixed off by one error: could call memcpy() with '0' as size argument.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-31 01:17:25 +00:00
Axel Dörfler
d1407b9d2b The "PANIC" line will now also appear on the blue screen, not only over serial.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-30 23:09:36 +00:00
Axel Dörfler
f4e5c34143 cache_abort_transaction() freed the wrong block, and thus causing a file system
corruption even better than during its absence.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-30 16:54:08 +00:00
Axel Dörfler
ac5af8f1b4 The maximum allocation size we've configured our allocator is 1 GB. Instead
of running into an assert() later on, we now back out early in this case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12902 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-30 14:10:06 +00:00
Axel Dörfler
c88974d026 The app_server now updates the kernel's blue screen frame buffer on mode changes
(only the accelerant HW interface does this for now).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 20:23:00 +00:00
Axel Dörfler
f33c8020e2 Removed debug/console.c, we no longer need it. frame_buffer_console_init() is now
called by debug_init_post_vm().
Since the availability of a blue screen specific getchar() is static anyway, there
is no need for the sBlueScreenGetChar variable (only the message "only serial input
available" gets lost, but since that is platform specific anyway...).
Hello blue screen! We now have an on-screen KDL, to be enabled by the kernel
setting "bluescreen", just like on BeOS.
The blue screen does not yet support any cursor actions or backspace, though (need
to grab some stuff from our console driver).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 16:23:00 +00:00
Axel Dörfler
395c6c62f2 Renamed arch/dbg_console.h to arch/debug_console.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12893 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 14:34:03 +00:00
Axel Dörfler
45c54054f7 No longer needs to include <arch/dbg_console.h>
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12892 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 13:33:30 +00:00
Axel Dörfler
2b8d85854d Renamed arch_dbg_console.c to arch_debug_console.c, dbg_console.h to debug_console.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12891 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 13:31:15 +00:00
Axel Dörfler
9a63135f7c Cleanup of the debug stuff, prepared for blue screen debugging.
kernel_debugger() didn't do enough before; panic() did all the work - but
since the former is a public function as well, I moved all the functionality
to it. Also fixed a possible buffer overrun in panic().
Renamed dbg_* to debug_*.
"serial_debug_port" setting did not ignore negative values.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 13:01:38 +00:00
Axel Dörfler
24b2daf33d Slightly improved debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 12:53:56 +00:00
Axel Dörfler
1b22c05ae8 Fixed warning I introduced before.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12887 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 11:33:45 +00:00
Axel Dörfler
2e95dad4b9 strerror() no longer reports "Unknown Application Error" for positive values,
instead it now says "No Error".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 10:51:47 +00:00
Axel Dörfler
9620c1d716 rename_thread() was broken for the current thread: updating the name is
hardly atomic, so we need to grab the thread lock after all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12877 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 00:29:45 +00:00
Axel Dörfler
d9152a2dfe We now accept NULL as a thread name (in which case it will get a default name).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 00:20:18 +00:00
Axel Dörfler
1d2f53e0ba Disabled debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12874 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 00:17:02 +00:00
Axel Dörfler
b3ef4fb41a Oops, forgot to implement cache_abort_transaction(); every failing transaction
could have destroyed the BFS integrity... (just happened to me, that's how I
noticed it)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-28 15:11:18 +00:00
Axel Dörfler
9f8298d908 Added empty functions for _k{get|set}_cpu_state_().
That makes Pulse to build and even run (but with no visible output) on Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-28 13:57:02 +00:00
Axel Dörfler
140e3bb026 Instead of the ugly and unnecessary cookie union, we now have a cookie for
opened devices, and one for opened directories.
Also adds and removes those directory cookies correctly now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12855 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-27 00:43:01 +00:00
Axel Dörfler
b716c3307f Removing the cookie must be locked as well, of course.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12854 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-27 00:41:00 +00:00
Axel Dörfler
0f04de87a7 The directory cookies of open directories are now correctly maintained and
removed when no longer used (the same bug is still present in devfs, btw,
and can potentially cause crashes).
Cleanup of the cookie code, it's now using util/list.h.
Now issues B_STAT_CHANGED notifications when directory entries changed.
rootfs_rename() was completely broken for "inter-directory" movements.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12850 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 19:56:41 +00:00
Axel Dörfler
8cd812c172 Forgot to uncomment this line: the "depth" argument of the vesa file is now also
evaluated, so that you can specify something different than 8 bit in there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12840 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 12:05:31 +00:00
Axel Dörfler
028aae6c9c Another improvement of the debug code - it seems to has a different cause than I thought.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12839 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 12:02:29 +00:00
Axel Dörfler
b82b759368 Additional debug stuff in order to have the power to fix an annoying bug
(mostly happens in the kernel debugger). Not tested, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 10:39:12 +00:00
Axel Dörfler
8bd36612dc First try to get the boot logo displayed properly in all color spaces.
For some reason, the colors are wrong for anything but 8bit modes, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12823 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 07:47:19 +00:00
Axel Dörfler
1333009e1c {rootfs|devfs}_read_link() did not report the correct link size on
success (they just kept the passed in buffer size unchanged).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 02:04:00 +00:00
Axel Dörfler
a460a8f084 More or less rewrote the heap wall stuff:
- it's now much cleaner than before
- it now actually works in combination with realloc() (the fix from before didn't work)
- got rid of the WALL_ALIGNMENT definition
- can now handle different WALL_SIZEs


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 01:39:38 +00:00
Axel Dörfler
da8c77faa3 The wall checking code now also works in combination with realloc(), and
it's a tiny bit cleaner, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-25 18:38:36 +00:00
Axel Dörfler
6d352d08b3 Added an arch_get_caller() function that returns the caller of the calling function :-)
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-25 13:58:32 +00:00
Axel Dörfler
14a578f640 If compiled with USE_WALL, check_wall() will now be exported, so that
it can be called from the outside.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12809 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-25 13:41:14 +00:00
Axel Dörfler
ff229e1ebb The buffer passed over from the boot loader is now null terminated.
load_driver_settings() now accepts absolute paths as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-25 13:35:46 +00:00
Axel Dörfler
4195ac0c53 The devfs directory entries are now always sorted.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12803 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-25 00:41:32 +00:00
Axel Dörfler
28dd47de9e Fixed the last commit: after we have acknowledged the interrupt, the
interrupt service register bit is never set, anyway...
Thanks to Korli for reporting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12801 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-24 18:44:39 +00:00
Axel Dörfler
49cb24e833 Added workaround for spurious interrupts on line 7/15 - they are no longer
forwarded to the standard interrupt handler. Untested, though.
For more information on the subject: http://www.ggd.nsu.ru/~serg/bsdfaq/part3.html#316
Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-24 17:05:40 +00:00
Axel Dörfler
ada5975312 fs_mount() and get_file_system() can now both handle file system names
in the form "bfs" and "file_systems/bfs/v1".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12791 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-23 18:22:04 +00:00
Axel Dörfler
47f39c93cb Merged the disk device manager module interface for file systems with the
VFS's interface, so that a file system only has to implement one interface.
As a side effect, the automatic file system detection may now work (not yet
tested, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-23 17:15:56 +00:00
Axel Dörfler
bad54f6fa4 Added symbol exports for _kset_mon_limit_() and _kset_fd_limit_().
Don't do anything yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-22 23:50:01 +00:00
Axel Dörfler
97c5bef4a1 Added missing assembly functions for __swap_float() and __swap_double().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12767 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-22 23:16:55 +00:00
Axel Dörfler
fe9bc5ae27 Added sqrt() and sqrtf() assembly versions.
Still they are not yet really used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-19 14:13:22 +00:00
Axel Dörfler
62f9753de5 Added public domain versions of sin() and cos() (taken from glibc).
Not yet used, though - we probably need to rearrange the source files a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-18 22:19:35 +00:00
Andrew Bachmann
dfdc5e411e use "national" math (fixes copysign/drem)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-18 20:43:52 +00:00
Axel Dörfler
62d6961672 Renamed vm.c to vm.cpp and made all the changes to let it compile without
errors. Also made the VM headers C++ safe.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12694 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-16 23:17:45 +00:00
Axel Dörfler
8f8d46a3ff vm_put_area() now gives feedback wether it deleted the area or not (it
will return true in the former case).
vm_delete_areas() is now using this information to print out a warning
in this case (so that a missing vm_put_area() can now be found easier).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-16 22:37:34 +00:00
Axel Dörfler
4393552b4d The heap is now located at 384 MB, and creates a reserved range that spans over the
following 1152 MB - that area only guarantees that the heap can grow this much before
the application need the memory for something else. And even then, the heap range
is reused from top-to-bottom, allowing for maximum heap usage. Of course, if the
memory after the heap range is not claimed yet, it can still be claimed by the heap,
too. Added new syscall to create the reserved range.
Fixed a bug in vm_delete_areas(): when it removed reserved areas, the area list
could get messed up.
Fixed a bug in resize_area(): resized areas could never be deleted (missing vm_put_area())!
resize_area() now supports reserved regions (but not perfectly yet, see ToDo items).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-16 22:15:13 +00:00
Axel Dörfler
a3e9996e9d Added support for special reserved address ranges: they will be used
only if memory becomes tight, and then the range is used from end to
start.
This is useful to reserve heap address ranges.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-15 15:56:55 +00:00
Axel Dörfler
20a6e5473b Renamed RESERVED_REGION_ID to RESERVED_AREA_ID.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12674 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-15 15:06:57 +00:00
Axel Dörfler
ccc8865ba2 Added an additional flag B_OVERCOMMITTING_AREA (currently to be specified
along the protection flags).
Changed the handling of B_STACK_AREA types and anonymous vm_areas: now
every area can overcommit if B_OVERCOMMITTING_AREA was specified.
B_STACK_AREA areas are still automatically overcommitting, but
B_KERNEL_STACK_AREA areas no longer.
vm_store_anonymous_noswap.c now only tests for guard pages if there were
any specified which is only done for B_STACK_AREA areas.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-15 15:03:44 +00:00
Axel Dörfler
d5b04e50f8 First step into a new block allocation strategy for the block_cache
(right now, it's still malloc/free, just encapsulated in an allocator class).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-13 18:18:28 +00:00
Axel Dörfler
0faec19e8a Cleanup, turned off debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-12 23:43:39 +00:00
Axel Dörfler
6bdc405f75 Whenever KPath is used, it will now be tested if it could be initialized
(thanks to Ingo for the reminder...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12652 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-12 23:31:04 +00:00
Axel Dörfler
90a0e0b9d9 Cleanup, turned off debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12651 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-12 23:29:28 +00:00
Axel Dörfler
6094d89f2f Merged branches/developer/axeld/driver_recognition changed r12307:12637 into trunk.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12638 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-12 03:27:44 +00:00
Axel Dörfler
cbd1d9977f Changed all _kern_*() calls to use KPath instead of a path buffer on the stack.
This reduces the stack usage quite a lot, and since file system calls could be
nested (for example, a mounted image on a volume), definitely a must, too.
Might be a good idea for user calls, too, though, although it's not urgent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-12 01:14:01 +00:00
Axel Dörfler
895e2a0375 Reenabled the Qemu workaround: the frame buffer is now cleared after a mode change.
After all, there might be real graphics card which behave the same??


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12551 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-03 02:06:08 +00:00
Axel Dörfler
0953c83ebd Fixed another bug: after a partition had been mounted, it was only marked
mounted, but no one told it about its volume ID - that caused "mountvolume"
not to be able to return a valid mount point.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-03 01:59:17 +00:00
Axel Dörfler
47729f044c Fixed a possible bug in path_to_vnode(): if called before a root
file system has been mounted, it would have crashed (that for example
happened if you deleted the kernel settings file...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-03 01:05:20 +00:00
Axel Dörfler
b20667b35b {install|remove}_io_interrupt_handler() now correctly handle the B_NO_ENABLE_COUNTER flag.
Lots of cleanup:
- moved B_NO_ENABLE_COUNTER flag definition out of int.h to KernelExport.h, as it's
  described in the BeBook (although it's probably not really used that often :))
- int.c no longer has any platform dependent code (+ 0x20 on interrupt numbers is gone);
  it's now entirely handled in the arch/x86/ section.
- the io_vectors[] is now statically initialized, instead of allocated from the heap
- removed {install|remove}_interrupt_handler(); they weren't that useful, arch_smp_init()
  is now calling install_io_interrupt_handler() correctly instead
- introduced a new arch_int.h header file that currently contains NUM_IO_VECTORS only
  (though on x86, it also has ARCH_INTERRUPT_BASE == 0x20).
- changed the return type from {install|remove}_io_interrupt_handler() from "long" to
  "status_t"
- rearranged and cleaned the PIC initialization code, made the PIC code more prominent
- changed comments that talk about a non existing 8239 (the PIC chip is actually 8259)
- moved arch/x86/interrupts.h to the source directory, as it's not used outside
- added BeOS compatible interrupts_enabled() function, that should replace our
  equivalent (and private) are_interrupts_enabled()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-27 01:08:35 +00:00
Axel Dörfler
0f757dc5df This fixes the build with GCC 3.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-14 22:15:38 +00:00
Axel Dörfler
b51d2e941a Now uses the ring_buffer implementation instead of cbuf.
Decreased the pipe buffer to 32768 bytes (it's 4096 on BeOS).
pipefs_select/deselect() did no locking.
Switched to using the BenaphoreLocker where possible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 22:43:35 +00:00
Axel Dörfler
900849fa0d Since objects/.../system/kernel is now a directory, the kernel target is now
called kernel_${arch} like on disk. A "jam kernel" will still work, though.
Also updated all those Jamfiles I forgot to update before.
Since makehdimage now runs through (and even builds a working image), I guess
most of the consequences of the "kernel/core" -> "system/kernel" rename task
are solved.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12364 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 14:49:55 +00:00
Axel Dörfler
718b5114e0 This should fix the build after all the kernel/system renaming.
If anything is still broken (and was not before :)), please shout.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 13:59:17 +00:00
Axel Dörfler
2d690920ac Renamed system/core to system/kernel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12360 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 13:22:10 +00:00
Axel Dörfler
5af32e7526 Renamed src/kernel to src/system.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-13 13:06:35 +00:00