cache_node_{opened|closed}() now correctly get the file_cache_ref from a vm_cache_ref.
Implemented cache_prefetch(): for now, it always prefetches the first 64 kB from the file.
Renamed read_from_cache() to read_into_cache().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10438 a95241bf-73f2-0310-859d-f6bbb57e9c96
different types to vnodes.
Renamed vfs_get_vnode() to vfs_lookup_vnode() as it doesn't grab a ref to the node.
Added new vfs_get_vnode() that actually grabs such a ref.
vfs_get_vnode_cache() now fills a vm_cache_ref instead of a void pointer.
Replaced SYS_MAX_NAME_LEN constants with the B_FILE_NAME_LENGTH that should have
been used there.
vnode::cache should have been a vm_cache_ref and is now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10431 a95241bf-73f2-0310-859d-f6bbb57e9c96
Later on (but before R1), we should find a better balance between what
the FS has to implement, and what the kernel delivers to them.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10399 a95241bf-73f2-0310-859d-f6bbb57e9c96
implementation that the two public functions call.
Adapted to the changes to _kern_open_query().
Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10398 a95241bf-73f2-0310-859d-f6bbb57e9c96
file descriptor, not from/to the attribute...
Added ToDo comment about eventually adding syscalls for these functions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10373 a95241bf-73f2-0310-859d-f6bbb57e9c96
fd_and_path_to_vnode() now accepts NULL as path argument.
Added some more debug output and comments.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10368 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also fixed a minor bug in dec_vnode_ref_count(): the unusued vnode counter
was not decremented again when one vnode was removed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10336 a95241bf-73f2-0310-859d-f6bbb57e9c96
more than once, the size requested was only correct for the first time.
Added preliminary support for cache modules.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10335 a95241bf-73f2-0310-859d-f6bbb57e9c96
actually fills a cpuid_info structure. Renamed cpuid() to get_current_cpuid().
Added syscall _user_get_cpuid().
Added a lot of other vendor brand strings. The cpu_type and cpu_revision
fields should now be correctly set.
get_cpuid() now returns B_BAD_VALUE if the cpuNum parameter is out of bounds
(ie. higher than the number of available CPUs in the system).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10321 a95241bf-73f2-0310-859d-f6bbb57e9c96
implementation by a syscall. Moved cpuid.S to src/kernel/core/arch/x86.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10318 a95241bf-73f2-0310-859d-f6bbb57e9c96
limit, but this is not yet enforced. Added getter functions.
team_init() now returns a status_t.
System info stuff is now globally initialized in main().
get_system_info() now also reports the number of used pages, and calls the
architecture dependent function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10315 a95241bf-73f2-0310-859d-f6bbb57e9c96
added get_cpuid() function (does not respect the cpu parameter yet).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10314 a95241bf-73f2-0310-859d-f6bbb57e9c96
When the 0xe820 memory map method doesn't work for whatever reason (broken BIOS),
it currently just assumes to have 32 MB - it now also prints out a warning when
it does so.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10298 a95241bf-73f2-0310-859d-f6bbb57e9c96
and no longer relies on put_vnode() for the root node. This will also call
the FS release/remove vnode calls. Extended comments.
Added "flags" parameter to unmount.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10289 a95241bf-73f2-0310-859d-f6bbb57e9c96
(free_vnode()). Upon freeing, the file cache is now only written back if the
file is not deleted.
dec_vnode_ref_count() no longer frees vnodes that are not going to be deleted.
Instead, it will add them to an unused vnode list, so that they can be freed
if needed (currently only 512 unused vnodes will be kept around). This should
speed up the whole thing, and makes the file cache much more useful, as it's
no longer dumped after the file is closed.
fs_unmount() is not yet respecting this (ie. it doesn't free those nodes as
it should).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10287 a95241bf-73f2-0310-859d-f6bbb57e9c96
of BIOS32, SMBIOS, and DMI services.
Also implemented a get_bios32_service() function which you can use to get
access to that service (ie. for use by the PCI bus manager).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10286 a95241bf-73f2-0310-859d-f6bbb57e9c96
be done consistently if they are unmapped from memory - which is not yet
done.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10285 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added user_shutdown user control
Reverted to rtc_boot_time()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10278 a95241bf-73f2-0310-859d-f6bbb57e9c96
which doesn't use fd_to_filename() yet) and added it to the build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10271 a95241bf-73f2-0310-859d-f6bbb57e9c96
Ceccherini for the hint.
The first port ID is now 1 and not 0 anymore.
Added a first free slot hint to speed up port creation.
Added more debug output when tracing is enabled.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10260 a95241bf-73f2-0310-859d-f6bbb57e9c96
BeOS supports this as well, at least it's not documented in the BeBook
(but it's useful anyway).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10259 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed _user_set_tzspecs() to _user_set_timezone().
Renamed sTzFilename to sTimezoneFilename.
Moved rtc_print() into rtc_debug().
Fixed changing system_time_offset; since this is a shared 64 bit value,
we have to use atomic calls when we change it.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10253 a95241bf-73f2-0310-859d-f6bbb57e9c96
now uses system_time, because we don't have to return a real time
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10242 a95241bf-73f2-0310-859d-f6bbb57e9c96
and only the syscall is exported.
For now, it always returns B_ENTRY_NOT_FOUND - since the boot loader
does not have support for driver settings yet.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10237 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added _user_shutdown() and made it available as syscall.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10233 a95241bf-73f2-0310-859d-f6bbb57e9c96
Implemented F_DUPFD support for fcntl() - we no longer see any redirection errors when
booting into Haiku.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10221 a95241bf-73f2-0310-859d-f6bbb57e9c96
_user_create_area() and _user_clone_area() now inherit the read/write protection
for the kernel, too - before, it was always mapped read/write in the kernel,
but there is no reason to do that.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10214 a95241bf-73f2-0310-859d-f6bbb57e9c96
Calls set_area_protection() after relocating the images to make them
read-only for real.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10212 a95241bf-73f2-0310-859d-f6bbb57e9c96
an off_t as size argument.
Implemented new function vm_cache_write_modified() which will write all
dirty pages of this cache back to disk (using the new vm_page_write_modified()
function).
Fixed warnings when compiled with debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10205 a95241bf-73f2-0310-859d-f6bbb57e9c96
pages in a cache back using the store's write method. Doesn't optimize
disk access yet.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10204 a95241bf-73f2-0310-859d-f6bbb57e9c96
While we can tolerate the device driver to ignore the bytes argument when we
read from the device, we cannot do this for writes - now the code actually
takes this into account. Also added a comment about what to do when our own
driver is fixed :)
Implemented file_cache_sync().
file_cache_set_size() now uses vm_cache::virtual_size instead of the now
removed vnode_store::size. Also, it now resizes the vm_cache as well, so
that any no longer used pages are freed.
write_to_cache() now puts all pages in the modified list, so that they
can be written back easily.
Improved debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10203 a95241bf-73f2-0310-859d-f6bbb57e9c96
vm_cache::virtual_size is now used by the file cache code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10202 a95241bf-73f2-0310-859d-f6bbb57e9c96
dec_vnode_ref_count() now deletes the cache *after* calling the file system's
remove/release vnode function. Also, it will now write back any pending
changes in that cache before removing it.
Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10201 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now, it will only notify the read requests do gather the data.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10198 a95241bf-73f2-0310-859d-f6bbb57e9c96
move code from use of boot_time to use of system_time_offset
added _user_get_tzfilename
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10192 a95241bf-73f2-0310-859d-f6bbb57e9c96
this should be factored in kernel core to only have a system_time_offset
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10186 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved test main() into separate file under tests/.
Fixed warnings, some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10181 a95241bf-73f2-0310-859d-f6bbb57e9c96
timezone_offset is used to have a GMT real_time_clock()
initial set_timezone implementation (still not working)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10134 a95241bf-73f2-0310-859d-f6bbb57e9c96
timezone_offset is used to have GMT real_time_clock() and set_real_time_clock()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10133 a95241bf-73f2-0310-859d-f6bbb57e9c96
stuff belongs to userland), they are completely broken, too.
As a quick hack, they no longer disable interrupts, so that the env memory
can be accessed almost safely (in case its valid memory at all).
Please don't fix this, but remove those functions from the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10071 a95241bf-73f2-0310-859d-f6bbb57e9c96
arguments (which should have taken the dumped thread).
Improved "thread" debug output to have all data values at the same column.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10070 a95241bf-73f2-0310-859d-f6bbb57e9c96
were messed up because of that, most shell pipe access didn't actually work
(thinks like "cat x | grep y", or "a=`uname -m`) - they now do.
Added more debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10060 a95241bf-73f2-0310-859d-f6bbb57e9c96
must be changed again to arch_cpu_shutdown(), since it might not be safe
to properly shutdown from the kernel debugger.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10054 a95241bf-73f2-0310-859d-f6bbb57e9c96
not everything is in this one file.
Removed definition of STD_INSPIRED: this not only fixes some warnings, it
also removes functions that are not exported under BeOS, and there is no
reason to change that.
Added weak export of timelocal() in case STD_INSPIRED is not defined in
localtime.c.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10037 a95241bf-73f2-0310-859d-f6bbb57e9c96
and pipefs implementation, but was originally thought for a network stack).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10028 a95241bf-73f2-0310-859d-f6bbb57e9c96
from ftp://elsie.nci.nih.gov/pub/tzcode2004g.tar.gz
private.h and tzfile.h are in common with timezone compiler, so we put them in headers
Sorry to not use cvs import
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10024 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed a bug in the team thread start: it did not set sizeLeft correctly
before copying the arguments - shouldn't have had any consequences, though,
as the size of the arguments is known before.
Added a comment explaining the current layout of the main thread stack area.
Now makes use of B_STACK_AREA and B_KERNEL_STACK_AREA.
fill_thread_info() did not correctly set thread_info::stack_end.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10016 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed a bug in arch_init_tls() that did not support different stack sizes
(ie. didn't use the thread::user_stack_size variable).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10015 a95241bf-73f2-0310-859d-f6bbb57e9c96
B_BAD_HANDLER, vm_soft_fault() will just continue as if there is no fault()
function.
There is now support for the B_STACK_AREA and B_KERNEL_STACK_AREA protection
values: if the former is used, or the latter in combination with DEBUG_KERNEL_STACKS,
a number of guard pages is inserted at the bottom of the stack (depending on
the STACK_GROWS_DOWNWARDS/UPWARDS arch config).
In addition, user stacks are no longer committed completely, ie. they don't
reserve memory for their whole size, only as much as is needed. That may
result in applications crashing when they need a lot of stack and there is
no memory left. Before this change, you could not even run that application.
Since BeOS has a 16 MB stack for the main thread, you could only run about
2 applications with 64 MB before.
Due to these changes, we've now switched to the standard BeOS stack sizes.
Some minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10014 a95241bf-73f2-0310-859d-f6bbb57e9c96
- renamed setup_rtc_boottime() to __init_time()
- __init_time() is now initialized at libroot.so startup
- introduced new __arch_init_time() that does the arch dependent stuff,
for now it just sets the system_time() conversion factor (that's the
part that will change later on)
- os/time.c now keeps a pointer to the real_time_data around, not only
to the boot time - maybe we'll it for other stuff as well later.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9995 a95241bf-73f2-0310-859d-f6bbb57e9c96
the x86 protection model to page level protection only. It's currently needed
for BeOS compatibility, though we might want to get rid of it later. Thanks
to Jerome for stombling into this :)
arch_vm_translation_map_init_post_sem() did not return a proper status.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9989 a95241bf-73f2-0310-859d-f6bbb57e9c96
offset to recognize the boot volume.
This should work well enough for now (as long as you don't have too many
disks in your system).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9965 a95241bf-73f2-0310-859d-f6bbb57e9c96
versions 2.x and 3.x and fills the disk_identifier of the boot disk.
"Dumb" checksum/size recognition is not yet implemented (stores only the
size of the disk for now).
Does not yet create bios_drive structures for any other drives.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9962 a95241bf-73f2-0310-859d-f6bbb57e9c96
the boot partition, and calls platform_register_boot_device() for the
rest.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9961 a95241bf-73f2-0310-859d-f6bbb57e9c96
- added user data pointer to cache_transaction notifier
- added functions block_cache_set_dirty(), and block_cache_make_writable()
- cache_transaction_next_block() let's you iterate over all blocks in the transaction
- instead of binding the block contents to the transaction (read-only checked
out blocks did only see the unchanged blocks until the transaction was closed)
the block now always shows the current data - even if the old way had some
advantages, it was terrible to use
- the blocks were not correctly added to the transaction
- improved debug output
- can check if the read-only blocks were changed accidently (compile time option)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9936 a95241bf-73f2-0310-859d-f6bbb57e9c96
we don't want to copy them over to the kernel heap, we just don't free
the kernel args if the debug symbols are enabled - and since there are
no driver settings yet in the kernel, this is always for now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9931 a95241bf-73f2-0310-859d-f6bbb57e9c96
compatible; change vtable-label-prefix accordingly.
- removed inclusion of wchar.h, as this breaks the libstdc++-build (hopefully
this doesn't break anything ?!?)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9903 a95241bf-73f2-0310-859d-f6bbb57e9c96
which can be used to test haiku's own libstdc++ under R5.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9900 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved from mutexes to benaphores.
Removed partial write support of the old API.
remove_cached_device_blocks() will now actually free all remaining blocks.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9895 a95241bf-73f2-0310-859d-f6bbb57e9c96
to the arch independent section (pure laziness + I am not yet sure how this
will look like on other platforms).
Fixed the clone_area() command: B_CLONE_ADDRESS must not be used in the
same address space, because the area creation then can only fail.
Added an explanation on why the area is cloned at all.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9885 a95241bf-73f2-0310-859d-f6bbb57e9c96
we do not support mount() and unmount() anymore.
I've not removed that file in case we decide that we have to export those
functions for whatever reason.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9868 a95241bf-73f2-0310-859d-f6bbb57e9c96
The page_stats debugger command now understands queue names as well.
Some minor cleanup, improved error checking.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9861 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed vm_area::lock to vm_area::protection to be less confusing - wiring
is still called wiring, though (might be renamed to lock later, as that's
how BeOS calls it).
Renamed some global variables to match our naming scheme.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9860 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed all static global variables to have the 's' prefix.
acquire_sem_etc() now fails if B_RELATIVE_TIMEOUT and B_ABSOLUTE_TIMEOUT
are both set.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9854 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed a bug in snooze_etc(): it could define both, B_ABSOLUTE_TIMEOUT and
B_RELATIVE_TIMEOUT at the same time.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9852 a95241bf-73f2-0310-859d-f6bbb57e9c96
No longer crashes due to architectural VM restrictions (ie. the area
is kernel only but writable now - should be cloned).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9851 a95241bf-73f2-0310-859d-f6bbb57e9c96
and the kernel.
create_area() can now only create kernel areas.
_user_create_area() now directly calls vm_create_anonymous_region().
Removed broken find_region_by_address() and find_region_by_name().
Removed vm_find_region_by_name().
Renamed the idle thread stack areas.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9848 a95241bf-73f2-0310-859d-f6bbb57e9c96
This is a temporary solution, until moving to a global kernel export data struct
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9819 a95241bf-73f2-0310-859d-f6bbb57e9c96
will do this if this function is called by anyone other than the root
user.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9804 a95241bf-73f2-0310-859d-f6bbb57e9c96
for temporary memory anymore, it's the store's responsibility to do that
correctly now, and that functionality is reached via the vm_cache using
vm_cache_set_minimal_commitment().
Therefore, the vm_store commit() function now returns a status instead of
the size that could be commited.
Replaced the max_commit mechanism with one that cares about the available
memory, stores can reserve and unreserve such memory. The anonymous_commit()
will now fail in case it could not reserve the needed amount of memory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9777 a95241bf-73f2-0310-859d-f6bbb57e9c96
off to enable bright background colors. It's now always done which enabled
me to improve the slider colors a bit.
Therefore, console_set_color() no longer clears bit 8 from the background color.
Now no longer tries to change the palette in non-8-bit modes; that fixes
the strange colors I got in high and true color modes (VESA palette changing
would fail and the fallback VGA palette changing was responsible for the effect).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9772 a95241bf-73f2-0310-859d-f6bbb57e9c96
with an empty queue, it crashed. sem_info::latest_holder is obviously not
set correctly, and should be fixed.
Some cosmetics.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9771 a95241bf-73f2-0310-859d-f6bbb57e9c96
serial_init() is now called from start().
Changed the way the serial debug output is served: instead of having
the console node to dump everything to serial, too, only dprintf()
triggers serial output now.
dprintf() is now silent unless in debug mode; serial output could
be enabled separetely, though (currently only at build time).
There is no need to disable serial output while the menu is running.
Removed unnecessary grist from the Jamfile.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9756 a95241bf-73f2-0310-859d-f6bbb57e9c96
some stuff blinked and had wrong colors), we now have a new color scheme
in the boot loader. Not perfect, but looks okay and the same on Bochs and
real machines.
Made changing the colors again easier by moving most colors to constants.
We now have 3 lines for help texts.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9754 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now clears the screen and scrolls using the current colors (which allows
for other background colors than black).
console_set_color() no longer allows to set the 8 bit of the background
color which indicates blinking.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9753 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added comments about which colors can be used for what (unlike Bochs,
real systems support blinking modes, and therefore only 7 bits for
the background color).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9752 a95241bf-73f2-0310-859d-f6bbb57e9c96
or I am messing things up (it will now use good old VGA palette programming).
This fixes the strange colors on my system, should investigate on how to
properly use the VESA stuff here.
Debug output now goes through dprintf().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9751 a95241bf-73f2-0310-859d-f6bbb57e9c96
Now correctly removes the partitioning system from a device when it is no longer
needed. Also resets the parent pointer of its children.
Debug output now goes through dprintf() rather than printf().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9748 a95241bf-73f2-0310-859d-f6bbb57e9c96
the partition was deleted, but never removed from the partition list.
No longer prints out the root directory contents of all file systems.
Debug output now uses dprintf() rather than printf().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9747 a95241bf-73f2-0310-859d-f6bbb57e9c96
in the wrong direction for some time now, corrupting the argument area (user
apps would crash).
B_SYSTEM_TEAM is now reserved, so that no team can be created there.
Fixed some warnings when debug output is enabled.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9719 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed console_reader() function to keyboard_reader().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9718 a95241bf-73f2-0310-859d-f6bbb57e9c96
The inode now keeps track of the number of readers/writers.
Inode::BytesInChain() is now only used protected by the request lock.
Implemented some missing POSIX demands:
- when the last writer is closed, all waiting read requests are aborted
- pipefs_write() now returns EPIPE and signals the current thread with
SIGPIPE in case there are no readers left
- pipefs_read() will now return 0 in case there are no writers and no
unread buffers left in the pipe.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9717 a95241bf-73f2-0310-859d-f6bbb57e9c96
Correctly implemented devfs_create() - it will now open the an already
existing file if O_EXCL is not set, and no longer fail with EROFS.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9716 a95241bf-73f2-0310-859d-f6bbb57e9c96
divided into several parts, it could happen that overwrite the whole data
portion with data beyond the part that should have been read.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9706 a95241bf-73f2-0310-859d-f6bbb57e9c96
was running. Thanks a lot to Jerome Duval who found this!
Since TTY ECHO mode doesn't look too well with the old shell, it will directly
start "sh" now, which should be the bash.
No longer prints out the TTY used when started, but now sets (as usually
done in BeOS) the TTY environment variable.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9697 a95241bf-73f2-0310-859d-f6bbb57e9c96
Removed the fs_initialize_volume() function, as it's probably not going
to be needed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9695 a95241bf-73f2-0310-859d-f6bbb57e9c96
absolutely no reason to move them to B_SYSTEM_TEAM (additionally, during
startup, set_sem_owner() may crash).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9693 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed the last argument of _kern_mount() to be a string rather than a void pointer.
Greatly reduced the stack usage of _user_mount(); it now uses KPath instead
of on stack paths. It now also copies the parameter argument on the heap.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9692 a95241bf-73f2-0310-859d-f6bbb57e9c96
devfs_read_link() and rootfs_read_link() could write beyond the buffer
size passed in (off by one).
The comment for _kern_read_link() didn't fit to what the function really
did.
common_read_link() no longer null terminates the link - it's the file
system's responsibility to do that.
fs_read_link() is not supposed to return the length of the link anymore,
but only B_OK for success.
Note, we deviate slightly from POSIX here, where even a buffer too small
would be filled, and no terminating null byte has to be written at all.
We always return an error in case the buffer is too small, and the link
is not partially copied into the buffer.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9652 a95241bf-73f2-0310-859d-f6bbb57e9c96
Made the FS internal API a bit more consistent.
Removed devfs_unlink(), and devfs_rename() (which was just returning EROFS
anyway) - the devfs now appears completely read-only to the user. All
changes are triggered by kernel internal APIs (most usually through either
the devfs itself (old style drivers), the disk_device_manager, or the
standard device_manager).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9645 a95241bf-73f2-0310-859d-f6bbb57e9c96
Also implemented the now needed devfs_read_link() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9644 a95241bf-73f2-0310-859d-f6bbb57e9c96
yet, though, and just return B_ERROR.
devfs_unpublish_partition() now also returns B_ERROR since it's not yet
implemented.
Refactored the device publishing code, so that implementing devfs_publish_file_device()
will become easy.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9639 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added resolve_mount_point_to_volume_root() which does what
resolve_volume_root_to_mount_point() did. IOW the latter one didn't
do what it advertised.
* Fixed dir_vnode_to_path(). Basically broken due to the broken
resolve_volume_root_to_mount_point(), but also compared potentially
unrelated vnode IDs (belonging to different volumes).
* Fixed get_dir_path_and_leaf(). It didn't deal correctly with paths
ending in '/' (including the root dir).
* fs_mount() does now accept a NULL fsName, getting the FS name from
the DDM in this case.
* fs_mount() now also supports mounting file images; it lets the DDM
create a file device for them.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9629 a95241bf-73f2-0310-859d-f6bbb57e9c96
done by (currently not existing) devfs functions.
* Overridden GetMediaStatus() and GetGeometry() to return useful data.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9627 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved the debug macros into the program flow, so that they don't look so
temporary :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9557 a95241bf-73f2-0310-859d-f6bbb57e9c96
* fs_mount() and fs_unmount() are now aware of partitions. A device to
be mounted is looked up by the DDM and the mount state and mount
cookie of the corresponding KPartition are updated accordingly.
Still missing is support for mounting files. Moreover the device path
needs to be normalized.
* Added RecursiveLockAutoLocker class to ease the `goto errN' pain a bit.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9555 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Made GetMediaStatus() a bit more robust. If the ioctl fails (e.g. if it
is not implemented as in Thomas' drivers), it gets the device geometry
and does not fail, if the device is not removable.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9546 a95241bf-73f2-0310-859d-f6bbb57e9c96
to be able to have more than 1280x1024x8 resolutions. The best solution, however,
would be to map the graphics memory outside of the kernel space, anyway.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9537 a95241bf-73f2-0310-859d-f6bbb57e9c96
it switched to the logo mode afterwards).
Improved and broke the second call of platform_switch_to_logo() with a
different video mode: it now at least works when switching to a lower
resolution.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9535 a95241bf-73f2-0310-859d-f6bbb57e9c96
and that main2() cannot therefore just wait until interrupts become
enabled.
Now, the main2() thread is resumed after interrupts are turned on.
I am not yet sure if this is really necessary, but I have the feeling that it is.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9531 a95241bf-73f2-0310-859d-f6bbb57e9c96
Improved the threads list: despite looking much better, it now also prints
out the semaphore number a thread is waiting on.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9530 a95241bf-73f2-0310-859d-f6bbb57e9c96
the "cursor".
Now disables serial output when the boot menu is shown.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9528 a95241bf-73f2-0310-859d-f6bbb57e9c96
When the debug boot option is set, or ENABLE_SERIAL defined on compile time,
the serial port 1 is activated.
It will also read the serial base port info from the BIOS data and use
that if any ports are reported (will fall back to 0x3f8 if not).
Right now, a fixed baud rate of 115200 and 8n1 is used.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9527 a95241bf-73f2-0310-859d-f6bbb57e9c96
Menu::Supermenu() now work.
Added function to find an item by label.
The boot volume menu now actually lets you choose a different boot volume.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9525 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added the new arch_dbg_con_early_boot_message() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9518 a95241bf-73f2-0310-859d-f6bbb57e9c96
change the flow of things, it now has its own buffer, and fills it with
interrupts disabled (everything comes at a price).
Now uses the safe vsnprintf() instead of vsprintf() which could crash
the kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9510 a95241bf-73f2-0310-859d-f6bbb57e9c96
thread. That also allows kernel threads to use the FPU as well.
arch_thread_enter_uspace() no longer needs to initialize the FPU.
i386_stack_init() is now only called once, in arch_thread_init(), as
thought.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9508 a95241bf-73f2-0310-859d-f6bbb57e9c96
want it to find; therefore, we're now using get_next_loaded_module_name().
Added a temporary suffix to the FS DDM modules (disk_device/v1) - they
might get merged with the standard FS interface modules.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9503 a95241bf-73f2-0310-859d-f6bbb57e9c96
eventual user stack regions of the thread.
The registers are no longer jumping around depending on the length of their values.
Removed some unused or doubly included headers.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9479 a95241bf-73f2-0310-859d-f6bbb57e9c96
We now have a working periodic wall checker, enabled by USE_CHECKING_WALL.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9459 a95241bf-73f2-0310-859d-f6bbb57e9c96
list (but not the structure itself).
Now calls heap_init_post_thread(), heap_init_post_sem() was called ..._postsem() before.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9457 a95241bf-73f2-0310-859d-f6bbb57e9c96
arch_cpu.h no longer includes kernel.h, so we have to do this for the
ROUNDUP()/ROUNDOWN() macros.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9441 a95241bf-73f2-0310-859d-f6bbb57e9c96
they are called.
Fixed some return types (mostly from int to status_t).
Some minor other cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9440 a95241bf-73f2-0310-859d-f6bbb57e9c96
they are called.
Introduced a cpu_init_post_vm() that will now call arch_init_post_vm() instead
of letting main() doing it.
Fixed some return types (mostly from int to status_t).
Some minor other cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9439 a95241bf-73f2-0310-859d-f6bbb57e9c96
three code locations that didn't handle them properly (when iterating over all
areas).
That and the fact that unmap_and_free_physical_pages() is no longer broken now
leads to the boot region being unmapped and freed properly as intended before.
That revealed another bug: the boot loader region was disposed too early, we
need a few other components pick up boot loader resources first; it now happens
in vm_init_post_sem().
allocate_kernel_args() was also broken, and actually didn't try to allocate
kernel args areas, but tried to reallocate all the virtual allocated ranges
of the boot loader...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9437 a95241bf-73f2-0310-859d-f6bbb57e9c96
boot loaders passed in memory completely wrong (for example, the premapped
graphics buffer could be mapped to the same region as some thread stacks,
just because the VM did not use its knowledge about that mapping): the boot
loader regions are now reserved so that they cannot be overwritten
with other regions anymore. The kernel_args arguments are now tracked, and
areas are created for them (they are not yet freed, though). arch_vm_init_end()
must now call the new vm_free_unused_boot_loader_range() to free any remaining
parts of the memory not yet mapped in by any areas.
Renamed a lot of init functions (ie. postsem to post_sem, init2 to post_area),
also updated because of the vm_translation_map*() arch_vm_translation_map*() move.
B_ALREADY_WIRED can now only be used during kernel startup (it's a private flag).
Replaced PAGE_SIZE with B_PAGE_SIZE.
Some minor cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9429 a95241bf-73f2-0310-859d-f6bbb57e9c96
correctly by calling arch_vm_translation_map_init_kernel_map_post_sem().
dump_aspace() now behaves like all debugging functions should behave: it
now accepts decimal numbers as well as hexadecimal numbers as IDs.
vm_translation_map_create() was renamed to arch_translation_map_init_map().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9427 a95241bf-73f2-0310-859d-f6bbb57e9c96
Moved some functions around, so that the public functions come last.
Renamed the internal vm_translation_map_quick_query() to early_query(),
renamed vm_translation_map_quick_map() to arch_vm_translation_map_early_map().
Removed the _module part of the initialization functions.
Added a function that completes the initialization of the kernel map (it
creates the map's lock, which was just not done before).
arch_vm_translation_map_init_map() will now fail with an appropriate
error code if the map's lock couldn't be created for anything that
is not the kernel map.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9426 a95241bf-73f2-0310-859d-f6bbb57e9c96
loader preallocated, arch_vm_init_end() (formerly called _endvm())
now calls the new vm_free_unused_boot_loader_range() with the correct
parameters.
Moved the creation of the DMA area from 0-0xa0000 into arch_vm_init_post_area().
Changed return types to status_t rather than just having "int" stand
for a status code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9425 a95241bf-73f2-0310-859d-f6bbb57e9c96
Most importantly, it now always uses map_physical_memory(), and no longer
relies on eventually mapped data by the boot loader (that the VM didn't
know about).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9418 a95241bf-73f2-0310-859d-f6bbb57e9c96
Exports the new insert_address_range() function as declared in boot/addr_range.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9416 a95241bf-73f2-0310-859d-f6bbb57e9c96
Added a kMaxKernelSize constant to be able to change that limit a bit
easier.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9415 a95241bf-73f2-0310-859d-f6bbb57e9c96