Commit Graph

2242 Commits

Author SHA1 Message Date
Axel Dörfler
2b9e2cec46 Fixed warning (GCC 3).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-20 17:58:58 +00:00
Axel Dörfler
623d7696c0 Added a platform_register_boot_device() stub function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10908 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-20 17:40:46 +00:00
Axel Dörfler
5629cb08f3 Have I already mentioned how amazing many bugs can be in such a short code snippet?
cache_io() should now finally work correctly in all cases.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-20 17:15:42 +00:00
Axel Dörfler
17351b0417 If we remove bochs support from the build system one day, make sure that
this file still does the right thing as suggested by Michael Pfeiffer.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 17:32:06 +00:00
Ingo Weinhold
327a7d825f The FD supplied to _user_open() was not passed to file_open().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 14:59:05 +00:00
Ingo Weinhold
791e6b3a75 BOCHS_DEBUG_HACK is always defined (to 0 or 1). Reported by Gert van Valkenhoef.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10873 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 14:19:35 +00:00
Ingo Weinhold
285449a68f Default arg in implementation. Reported by Gert van Valkenhoef.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10872 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 14:16:01 +00:00
Axel Dörfler
19b83dc2b3 Got rid of ERR_VM_NO_REGION_SLOT - we now return BeBook friendly error codes.
Added short description to find_reserved_area() as that name is not that good.
vm_reserve_address_range() now doesn't do anything if the requested size
of the reservation is zero.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 03:17:25 +00:00
Axel Dörfler
0f4c53b1d0 Better debug output, minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10866 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 02:59:00 +00:00
Axel Dörfler
0f8e6927d8 Fixed another big and stupid bug: the first read/write not in the cache
and not on a page boundary had been executed with a I/O size too large,
and thus clobbering all sorts of memory (oh my god).
The problems with ResourceFile now seems to be gone.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 02:35:39 +00:00
Ingo Weinhold
ffb6ed34b3 Fixed build with debug output enabled.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10860 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-19 01:07:30 +00:00
Axel Dörfler
5e07b72508 Renamed probe() to register_device(), cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10849 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 19:03:01 +00:00
Axel Dörfler
dcbf2cb678 Now uses a driver/device exploration like R5; when a directory is looked
up for the first time, it will try to load all drivers that may export
devices there. Those devices will currently stay loaded, though - this
will only be changed when load_kernel_add_on() is able to cache add-ons.
Renamed pnp_devfs_probe() to pnp_devfs_register_device().
Fixed debug output for devfs_create().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10838 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 16:51:21 +00:00
Axel Dörfler
568f1574d2 dev_init() and bus_init() are now both obsolete.
con_init() now takes care of the initialization of its currently built-in
console drivers itself.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 16:44:44 +00:00
Axel Dörfler
19abe05796 Removed dev.c as it's no longer in use (driver loading is now done by
the device manager).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 16:39:33 +00:00
Axel Dörfler
321fcdaf57 Removed ToDo comment about removing kernel.so - actually, we'll keep kernel.so
because it has some advantages over a relocatable kernel.
Removed libbus.a as it's no longer needed.
kernel.so now depends on kernel, so that both files are updated at once.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10834 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 16:37:49 +00:00
Axel Dörfler
a9435d9740 Some work in progress cut back to support R5 style device exploration.
Also includes the loader of R5 styled drivers (taken from dev.c).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10833 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 16:29:40 +00:00
Axel Dörfler
339a06ca55 get_vnode_name() now handles a NULL parent vnode gracefully (and returns
an error in case the vnode name could not be retrieved without it).
Comment cleanup for consistency.
Renamed remaining "omode" variables to openMode.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 15:59:18 +00:00
Axel Dörfler
e8edb8545b A hash_lookup() to the module images was made without having the proper lock held.
Added kernel private calls load_module() and unload_module() that can be used to
load/unload modules by path.
load_module_image() now only mentions when it couldn't load a module when tracing
is enabled (because the device manager uses it to determine if an add-on is a
module or an old-style driver).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-18 02:37:38 +00:00
Axel Dörfler
cdde948ccc Fixed compilation in case COMPILE_FOR_R5 is defined.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-17 22:35:28 +00:00
Axel Dörfler
c004da882f Fixed compilation issues that came with changing it to be C++ (hi mmu_man :-)).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10809 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-17 22:23:20 +00:00
Axel Dörfler
7e536c5607 Renamed probe.c to probe.cpp to prepare if for all the changes it got.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-17 22:19:43 +00:00
Ingo Weinhold
523144419b * utsname::sysname is the name of the OS while system_info::kernel_name is
the name of the kernel file. Now return "Haiku" as operating system.
* Even if we can't fill in utsname::nodename with something useful yet,
  fill in at least something.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10782 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-17 01:18:56 +00:00
Ingo Weinhold
7e3ac9f35f Changed return value of read_port[_etc] from status_t to ssize_t. That's not how it is declared in R5, but it is what actually is returned.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10761 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 21:45:13 +00:00
Ingo Weinhold
2751025516 Temporarily added debug_[v]printf() functions for userland usage, equivalent to dprintf() in kernel.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10760 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 21:44:16 +00:00
Ingo Weinhold
6fef29ae45 * Changed return value of read_port[_etc] from status_t to ssize_t. That's
not how it is declared in R5, but it is what actually is returned.
* Fixed _user_read_port_etc(): It didn't copy the message code back to
  userland, if the message had a size > 0.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10759 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 21:43:07 +00:00
Axel Dörfler
cafa4dd931 Removed next_dev() again - it's implemented in libroot/os/fs_info.c and
now used from there, sorry Ingo (I forgot to commit the Jamfile that
included fs_info.c).
Minor comment cleanup to make their appearance consistent throughout
the kernel.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 14:41:00 +00:00
Axel Dörfler
40174b5c1b Added fs_info.c functions to the kernel (next_dev, fs_stat_dev, ...).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 14:36:31 +00:00
Ingo Weinhold
40be269010 Added missing next_dev(). Axel?
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 13:46:04 +00:00
Axel Dörfler
d7e274c031 The "/tmp" symlink targeted the wrong location.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10741 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 01:27:04 +00:00
Axel Dörfler
e3954f5a94 acquire_sem_etc() really didn't like the combination of B_RELATIVE_TIMEOUT
and B_INFINITE_TIMEOUT -- it now does and won't start a timer anymore in
this situation. Reported by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10740 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 01:07:23 +00:00
Axel Dörfler
849647ec72 sync() now also syncs the vnode caches (file data).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10739 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-15 00:38:16 +00:00
Axel Dörfler
8b74caaae0 Brought dump_port_info() into shape, added output of port_entry::total_count.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10733 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-14 20:45:18 +00:00
Axel Dörfler
6158f7d53a Fixed a crashing bug in port_buffer_size_etc() - it had a special error
check for B_TIMED_OUT and B_WOULD_BLOCK, but it got through with other
errors.
Removed special error check for "known" error codes from port_buffer_size_etc(),
read_port_etc() and write_port_etc() - they no longer print out a warning in
that case.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10732 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-14 20:21:58 +00:00
Axel Dörfler
4d00c5e1ea We introduced the new constant B_CURRENT_TEAM for this.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-14 19:50:12 +00:00
Ingo Weinhold
2397da28a0 Added support for get_next_image_info() with team ID == 0, which means the current team.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-14 15:32:14 +00:00
Axel Dörfler
9c4f4c037d Changes because of renaming various data structures (pnp_node -> device_node, ...).
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-11 23:28:38 +00:00
Axel Dörfler
08ec614080 Changes because of renaming various data structures (pnp_node -> device_node, ...).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-11 23:26:00 +00:00
Axel Dörfler
b8877975aa Added some code to dump the node tree. This is currently done always
after hardware recognition (but will be moved into a debugger command
later).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-11 16:19:59 +00:00
Axel Dörfler
d1f630f624 Fixed some typos, minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10659 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 18:30:37 +00:00
Axel Dörfler
f1a1d6e98a Implemented get_safemode_option() (not yet tested).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 18:06:25 +00:00
Axel Dörfler
57af9fc29e Added a small program to control the cache (using the generic syscall mechanism).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 08:08:14 +00:00
Axel Dörfler
104de70bd8 Oops, the driver name was not propagated as needed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10644 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 08:01:39 +00:00
Axel Dörfler
c51144040d The BOCHS_DEBUG_HACK definition now only enables support for the bochs
debug output - to activate it, you now have to enable it in the kernel
settings file ("bochs_debug_output true").
Reimplemented the serial output so that it's flexible towards the base
port at run time.
Implemented support for kernel settings "serial_debug_port" (which can
now also be an index in the BIOS provided serial ports list), and
"serial_debug_speed".
That also means that you can finally use the same kernel executable
under BeOS Bochs and on a real system without any restrictions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10642 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:53:22 +00:00
Axel Dörfler
163338aef6 Now calls the new arch_dbg_con_init_settings() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10641 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:48:44 +00:00
Axel Dörfler
b15a7e8e0a Now initializes the driver_settings services (so that it can find the
settings passed over by the boot loader).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:47:51 +00:00
Axel Dörfler
74272e4c46 mutex_lock() will no longer panic() if acquire_sem() failed and the mutex
holder did not change (required for booting properly).
Also added a ToDo comment about a required mutex API change in order to
be able to return a status that indicates failure.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10639 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:46:48 +00:00
Axel Dörfler
486c7eddeb Added driver_settings support: it will now read in the vesa kernel driver
settings and use that one as standard video size (but ignores the depth
parameter for now).
It will be the app_server's responsibility to keep this file up to date.
This file should no longer be edited by users.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:41:01 +00:00
Axel Dörfler
4c89c923bf For now doesn't switch to text mode and back to the logo anymore when the
menu is shown - the logo is now shown after the menu anyway.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:38:01 +00:00
Axel Dörfler
78c5ef46fc Added driver_settings support.
It will now load all settings in the kernel driver settings directory
and pass them over to the kernel (unparsed).
Additionally, it allows other parts of the boot loader to access
driver_settings just like in the kernel.
Moved the switch to the logo in the boot loader much further to the end
of the boot loader's life cycle. This is done so that the boot loader
can directly use the video mode as configured in Haiku, without a jumping
logo. Since the delay will be noticeable on a real system, we might want
to introduce a second different boot logo, though. We'll see.
stdio.cpp now also exports errno (and _errnop). Might be changed to a
different approach later as well (it's now done this way so that strtol.o
can be taken over unchanged from libroot.so).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10634 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:32:54 +00:00
Axel Dörfler
a2940337b4 Added strcasecmp(), strlcat(), and strtol() to the boot loader in order to
be able to use the driver settings in a useful way.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:26:50 +00:00
Axel Dörfler
f753d9c494 Updated to export all the functionality we need from within the kernel
and the boot loader.
When compiled in the kernel, driver settings are cached and may be used
without disk access at all.
Added some comments.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10632 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 07:25:23 +00:00
Axel Dörfler
c776c35a04 Added a temporary way to differentiate between kernel and userland builds for
parts of kernel_os_main.o.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-10 01:32:11 +00:00
Axel Dörfler
0f6c560eec Removed the upper restriction of maximum cache transfers (was restricted
to 32 pages at a time out of pure lazyness).
Also fixed a potential bug when reading across page bounds (pageOffset
might not have been properly reset).
Added some more comments and ToDo items.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10627 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-09 22:40:30 +00:00
Axel Dörfler
f3d2f0ffa2 cache_module_info::node_opened() was called with the wrong argument order.
Added generic syscall to control the cache. Right now, only setting/removing
cache modules is implemented.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-07 00:55:08 +00:00
Axel Dörfler
2a5dafa804 recurse_directory() is no longer part of the build if SUPPORT_BOOTFS is
not defined. It will now also skip about all entries called "boot" (to
not load the boot modules again).
The path of preloaded images is now hacked together so that the module
image hash contains the correct path in case the images get replaced
while being used.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10600 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-06 21:46:03 +00:00
Axel Dörfler
b1e252f77f Added a SUPPORT_BOOTFS definition and made the vfs_get_module_path() the new
standard mechanism - recurse_directory() is now only used if SUPPORT_BOOTFS
is defined and vfs_get_module_path() failed.
Added standard system kernel add-ons directory to the search path list.
Renamed USER_MODULE_PATHS to FIRST_USER_MODULE_PATH as that's what it is.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10599 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-06 20:31:22 +00:00
Axel Dörfler
fb77bc372f vfs_get_module_path() now actually works: it failed to create a valid full
path, since it didn't take into account that vnode_path_to_vnode() may
actually change the provided buffer.
Also fixed a potential buffer overrun in that function (bufferSize was
not correctly changed), and added a comment about a previously undocumented
property of vnode_path_to_vnode() that vfs_get_module_path() relies on.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-06 20:20:48 +00:00
Jérôme Duval
d1e2263502 untested uname implementation
still lacking some way of getting/setting hostname in our kernel


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10484 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-17 16:23:22 +00:00
Jérôme Duval
5622a2e2c5 added get_rtc_info, needed in the kernel for services which use local timestamps such as the dos filesystem
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10463 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-15 09:23:50 +00:00
Axel Dörfler
e93e8b9a66 Removed unused mount/unmount commands.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-15 00:13:25 +00:00
Axel Dörfler
dbef8d930c As suggested by Ingo, the "subsystem" parameter is now a string. That allows
modules to use their module name directly.
Also introduced a whole range of reserved syscall functions in case we want
to add some more.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 17:09:06 +00:00
Axel Dörfler
f4160aedf9 Renamed semaphore syscalls to the new scheme.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10454 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 16:07:23 +00:00
Axel Dörfler
483a56e2fa Implemented a generic syscall mechanism. For example, kernel modules can use
this during runtime to add and remove specific syscalls. You can also use this
to add debugging or temporary kernel calls without messing up the syscall
table (the syscall numbers will stay constant).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 15:49:20 +00:00
Axel Dörfler
836356a0ca Since we now have a working B_BASE_ADDRESS, we don't need the "RLD_padding"
area anymore.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 04:02:42 +00:00
Axel Dörfler
c3808a9e47 Address specifier B_BASE_ADDRESS actually didn't work at all - it now does.
Renamed find_reserved_region() to find_reserved_area(), and
find_and_insert_region_slot() to find_and_insert_area_slot().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10446 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 04:02:11 +00:00
Axel Dörfler
8a16a1a0c9 lock_memory() now at least makes sure that the memory range is mapped in.
It's a bit hackish due to the iospace area, and it also might not work
perfectly in all situations, but it does fulfill the current needs.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 02:39:37 +00:00
Axel Dörfler
09eaf756d0 Included some code from NewOS to set up a double fault handler. Doesn't seem to work yet, though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10443 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 01:46:04 +00:00
Axel Dörfler
e082899afe Replaced SYS_MAX_PATH_LEN with B_PATH_NAME_LENGTH.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 23:15:25 +00:00
Axel Dörfler
220a60685b Updated because of some header changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10440 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 23:14:56 +00:00
Axel Dörfler
84a910b64f Updated because of header changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 23:02:18 +00:00
Axel Dörfler
a1d0963176 Locking of the vm_cache_ref was almost completely missing...
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
2004-12-13 22:58:40 +00:00
Axel Dörfler
fcab2bafe0 Added a pointer to the file_cache_ref to the vnode_store.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 22:47:41 +00:00
Axel Dörfler
d316037c89 Updated because of header changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10436 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 22:46:11 +00:00
Axel Dörfler
64e7394c50 PARANOID_POINTER_CHECK is now only defined if DEBUG is defined, too, by default.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 22:44:17 +00:00
Axel Dörfler
b2ac251743 Replaced SYS_MAX_PATH_LEN with B_PATH_NAME_LENGTH.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 22:19:26 +00:00
Axel Dörfler
204db7744a get_new_fd() now has a separate fs_mount parameter, so you no longer need to cast
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
2004-12-13 22:17:00 +00:00
Axel Dörfler
5d45bbd482 Now uses ASSERT_LOCKED_MUTEX() some more.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10429 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 22:05:47 +00:00
Axel Dörfler
3a5d1279cf vm_create_vnode_cache() now fills a vm_cache_ref instead a void pointer.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 22:05:05 +00:00
Axel Dörfler
cb44b765b0 Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 21:21:06 +00:00
Axel Dörfler
6363d47567 Better debug output to ease userland debugging while we don't have any tools.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 03:41:32 +00:00
Axel Dörfler
66340e6747 get_vnode_name() for file system's that do not export the fs_get_vnode_name()
function was slightly broken :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-12 23:12:08 +00:00
Axel Dörfler
4692c99460 Added function that allocates more than one page at a time, but without
the need for having them in a run.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10406 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-12 20:53:47 +00:00
Axel Dörfler
f6743bd145 Added query support - it's more or less the same as found in R5 for now.
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
2004-12-12 20:39:45 +00:00
Axel Dörfler
62ceb50f43 Refactored fs_open_query() calls a bit - there is no only one internal
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
2004-12-12 20:35:27 +00:00
Axel Dörfler
71a81208ef Fixed build and warnings. Thanks to Jonas for reporting this.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-12 16:19:46 +00:00
Axel Dörfler
e96f985d95 fs_read_attr() and fs_write_attr() transferred bytes from/to the provided
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
2004-12-08 02:15:09 +00:00
Axel Dörfler
6780f6f417 The open attr dir syscalls didn't work correctly in the FD modes.
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
2004-12-07 16:15:57 +00:00
Axel Dörfler
53b0609a4a Initial support for cache modules.
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
2004-12-01 07:41:07 +00:00
Axel Dörfler
324fc66b90 Fixed another stupid bug in cache_io(): if one request needed new pages
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
2004-12-01 07:38:27 +00:00
Axel Dörfler
26a78aa41d Removed broken _user_exit(), and implemented working _user_exit_team().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10328 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-01 04:26:10 +00:00
Axel Dörfler
71463c834e Now uses _kern_exit_team().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10327 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-01 04:24:15 +00:00
Axel Dörfler
72013b22a5 Now uses _kern_exit_team().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-01 04:17:57 +00:00
Axel Dörfler
2f9720f07d exit_thread() was using _kern_exit() instead of _kern_exit_thread().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-01 04:10:12 +00:00
Axel Dörfler
e25fbc6849 Moved cpuid.S from src/kernel/libroot/os/arch/x86/. Fixed it so that it
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
2004-12-01 03:48:28 +00:00
Axel Dörfler
fc4ff6bda0 Renamed systeminfo.c to system_info.c - also replaced the (broken) get_cpuid()
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
2004-12-01 03:31:45 +00:00
Axel Dörfler
7c3dbcf249 Threads and teams now maintain a used counter - they also provide a maximum
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
2004-11-30 21:11:37 +00:00
Axel Dörfler
e774a942a9 Implemented basics of the architecture specific get_system_info(), also
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
2004-11-30 21:08:19 +00:00
Axel Dörfler
f79889e75b Now also sets the cpu_clock_speed field.
Disabled debug output.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-30 20:59:55 +00:00
Axel Dörfler
d3ee51c1d2 Removed the ERR_VM_PF_BAD_ADDRESS constant, and use B_BAD_ADDRESS instead.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-30 18:27:38 +00:00
Axel Dörfler
caa0ef0b4c Some old changes, probably shouldn't get lost, even if this boot method
is not being used by the PPC anymore.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-30 17:37:56 +00:00
Axel Dörfler
058569262f get_memory_map() is now silent when TRACE_MMU is not defined.
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
2004-11-30 17:33:46 +00:00
Axel Dörfler
b5d786bdac Improved fs_unmount(): it will now free all vnodes directly via free_vnode(),
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
2004-11-29 22:45:27 +00:00
Axel Dörfler
4c8e8f2f19 Added "flags" parameter to unmount.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-29 22:42:01 +00:00
Axel Dörfler
41c3a7a3d5 Moved freeing the vnode out of dec_vnode_ref_count() into a separate function
(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
2004-11-29 21:27:17 +00:00
Axel Dörfler
86a48e24ad Got inspired by mmu_man's dmidecode release and added a simple identification
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
2004-11-29 20:42:04 +00:00
Axel Dörfler
22ca5e3c35 Added a comment to vm_page_write_modified() that writing pages can only
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
2004-11-29 15:52:49 +00:00
Jérôme Duval
3366fbde02 names are based on system_time
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10280 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-28 23:20:24 +00:00
Jérôme Duval
1850c408f9 fixed copyright
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10279 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-28 23:17:36 +00:00
Jérôme Duval
bfb2692a61 Fixed set_timezone()
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
2004-11-28 23:13:22 +00:00
Axel Dörfler
ffc023930d Reverted back to an older version of freopen.c (1.15 from sources.redhat.com,
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
2004-11-27 13:14:19 +00:00
Axel Dörfler
8e3485c460 No longer needed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10270 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-27 13:02:26 +00:00
Axel Dörfler
92af23fa88 Now uses the new Be-style constants for get_team_usage_info().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-27 12:57:36 +00:00
Axel Dörfler
f05c404379 Updated to the changes made to OS.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10267 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-27 12:54:58 +00:00
Axel Dörfler
9f30bca262 Moved _user_system_time() to real_time_clock.c.
Added safemode.h header.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-27 12:35:30 +00:00
Axel Dörfler
53c082117f Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10264 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-27 12:34:11 +00:00
Axel Dörfler
db4008e263 Removed references to ktypes.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-27 12:32:29 +00:00
Axel Dörfler
515d213528 create_port() incremented the used ports counter twice, thanks to Stefano
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
2004-11-27 12:03:48 +00:00
Axel Dörfler
50edebb6cb Added B_CURRENT_TEAM support to get_team_info() as well - dunno though, if
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
2004-11-26 16:37:41 +00:00
Axel Dörfler
b9ead42463 Support for B_CURRENT_TEAM was missing from get_team_usage_info().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-26 16:34:32 +00:00
Axel Dörfler
a09c4553a6 Made the get_safemode_option() function public.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10257 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-26 16:25:18 +00:00
Axel Dörfler
c591847918 Renamed _kern_set_tzspecs() to _kern_set_timezone().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-26 15:04:16 +00:00
Axel Dörfler
7c8c40ecb2 Moved _user_system_time() to real_time_clock.c.
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
2004-11-26 15:03:28 +00:00
Axel Dörfler
9b6593acae Now remembers the time spent in children/threads that are already gone.
Implemented get_team_usage_info() - not really tested, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10251 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-26 14:58:01 +00:00
Axel Dörfler
e7a9dbff59 Now uses the appropriate syscall.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10245 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-25 21:22:14 +00:00
Axel Dörfler
2ff908a59e Added empty get_team_usage_info().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-25 21:20:17 +00:00
Jérôme Duval
82f223ea8c Implemented times
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
2004-11-25 20:16:35 +00:00
Jérôme Duval
4693e9c7a5 Implemented getrusage
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-25 19:24:24 +00:00
Axel Dörfler
80899a91b9 Added libroot/os/arch/x86/thread.o to the rld.so build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-25 18:53:39 +00:00
Axel Dörfler
73e29ea0c4 Added empty get_safemode_option() call - right now, it's even private
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
2004-11-25 18:36:42 +00:00
Axel Dörfler
216b269cbc Moved shutdown() into a separate file.
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
2004-11-25 17:59:13 +00:00
Axel Dörfler
1e32802a52 New call new_fd_etc() which accepts a starting index for where to search for free FDs.
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
2004-11-25 02:56:35 +00:00
Jérôme Duval
766dfdaf6c fixed system_time_offset and sTimeOffset
added some trace


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-24 22:54:50 +00:00
Axel Dörfler
f19955303e _user_set_area_protection() did not set any B_KERNEL_*_AREA protection.
_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
2004-11-24 18:57:20 +00:00
Axel Dörfler
4bc2682135 First go at set_area_protection() - does work for everything but changing
a read-only area to read/write.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10213 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-24 18:22:17 +00:00
Axel Dörfler
983377dc3d Now only uses the file name instead of the full path as area base name.
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
2004-11-24 18:15:20 +00:00
Axel Dörfler
40ab990937 vm_cache_resize() can now resize all caches - and therefore, it now accepts
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
2004-11-23 03:34:04 +00:00
Axel Dörfler
86b5aa8df9 Implemented new function vm_page_write_modified() that writes all dirty
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
2004-11-23 03:30:02 +00:00
Axel Dörfler
257d99f228 Renamed readwrite() to cache_io(), and readwrite_pages() to pages_io().
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
2004-11-23 03:27:45 +00:00
Axel Dörfler
3aacbe700a Removed the vnode_store::size field - it's no longer needed. Instead,
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
2004-11-23 03:22:35 +00:00
Axel Dörfler
3e5bf45013 attr_dir_open() now checks if the FS call is implemented at all.
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
2004-11-23 03:20:20 +00:00
Axel Dörfler
e057f978ce Inode::FillPendingRequests() could fill the requests in the wrong team context.
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
2004-11-23 02:57:34 +00:00
Jérôme Duval
378a243ecc move from use of boot_time to use of system_time_offset
remove _get_tzfilename


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10194 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-23 00:20:30 +00:00
Jérôme Duval
2ecad4070b now use _kern_get_tzfilename
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-23 00:19:22 +00:00
Jérôme Duval
177fdbb034 renamed rtc_boot_time to rtc_system_time_offset
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
2004-11-23 00:16:24 +00:00
Jérôme Duval
e2383c107d fixed offset sign, gmt clock is working
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
2004-11-22 21:54:24 +00:00
Axel Dörfler
8039d342ec path & toPath don't seem to be too clear. Fixed order or arguments to the
kernel syscall and renamed them to be less confusing.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10183 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 20:29:07 +00:00
Axel Dörfler
4cd43d200d Removed R5 compatibility stuff, as it's not needed in our libroot.
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
2004-11-22 17:42:38 +00:00
Jérôme Duval
b39d4ade08 modified tzset to use the global tzfilename when no TZ env variable is found
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10180 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 17:35:13 +00:00
Jérôme Duval
56d0b9b6db added _get_tzfilename
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10179 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 17:33:43 +00:00
Jérôme Duval
377eab2488 added _user_set_tzfilename
moved set_tzfilename into _user_tzfilename


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10177 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 17:14:06 +00:00
François Revol
64829f93ff add find_directory to libroot build... someone test it ?
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10170 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 15:28:51 +00:00
François Revol
390738c37c Use correct syscall for Haiku; better error reporting; testing code
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10169 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 15:27:08 +00:00
François Revol
722a8c5d4d #define OSDIR to "beos" and use it, so we can later just change that
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10164 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 09:23:54 +00:00
François Revol
d457be4f45 make use of COMPILE_FOR_R5, make some things static.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10163 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 09:04:53 +00:00
François Revol
04495f1467 C version of find_directory, still needs some rework.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10162 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 08:55:46 +00:00
shatty
9e17ced40d suppress warnings on imported code
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-22 03:03:35 +00:00
Jérôme Duval
77950821de added new fields to the real_time_date replacement struct
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
2004-11-22 00:35:22 +00:00
Jérôme Duval
3787bef109 timezone_offset and dst_observed fields of real_time_data struct are inited
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
2004-11-22 00:32:22 +00:00
shatty
a8992af5b4 stub Debug.h functions including possibly-working flag debug flag functions
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10077 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-21 03:48:22 +00:00
Axel Dörfler
90d1241219 sys_setenv() and sys_getenv() are not only at the wrong place (that sort of
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
2004-11-21 00:01:59 +00:00
Axel Dörfler
7377137f87 Fixed a bug in the debugger "thread" command when it was called with no
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
2004-11-20 23:58:57 +00:00
Axel Dörfler
50686c7a7f putenv() was broken and actually cut off one character of the variable name.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10065 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-20 23:33:59 +00:00
Axel Dörfler
8210771d09 Oops, exec_team() should rename the team as well.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10062 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-20 22:31:28 +00:00
Axel Dörfler
77a6e0beb6 exec_team() now renames its main thread to the new program name.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10061 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-20 22:05:50 +00:00
Axel Dörfler
4f952f6c3a pipefs_create() didn't call Inode::Open(), and since the read/write counters
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
2004-11-20 21:51:01 +00:00
Axel Dörfler
50f99a085e Now properly allocates the kernel stacks of the other CPUs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10057 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 22:04:12 +00:00
Axel Dörfler
0641ddaabc Now uses the KERNEL_STACK_SIZE constant to allocate the idle thread kernel stacks.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10056 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 21:56:45 +00:00
Axel Dörfler
672ba60193 Removed unnecessary reference to ktypes.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10055 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 21:56:02 +00:00
Axel Dörfler
d621b8a482 Now uses the shutdown() function instead of reboot() directly. Maybe this
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
2004-11-19 21:55:12 +00:00
Axel Dörfler
8f60d4cdba Removed dumb put BeOS compatible cache implementation - it's not needed anymore.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10051 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 20:29:17 +00:00
Axel Dörfler
10b8d84f32 Added empty file_cache_sync().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10048 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 20:24:27 +00:00
Axel Dörfler
583565f02a Added unistd/sync.c to the kernel.
Removed unneeded source grist.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 20:19:53 +00:00
Axel Dörfler
5987043c75 Added new shutdown() function that at least does a sync() before rebooting
the system. Should shutdown all other things, too.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10045 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 20:18:27 +00:00
Axel Dörfler
fc5fb64131 Implemented arch_cpu_shutdown().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 20:16:52 +00:00
Axel Dörfler
137270c9e6 Readded our ctime.c - removed equivalent versions from localtime.c, so that
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
2004-11-19 19:44:09 +00:00
Axel Dörfler
d9dd2139b1 Removed misc.c from the build for now.
Removed unneeded grist from source files.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10029 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 19:12:21 +00:00
Axel Dörfler
48d914c9ce Disabled some unneeded checksum code (cbuf is still "abused" in our ports
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
2004-11-19 19:11:04 +00:00
Jérôme Duval
9b51d2f8fb Added implementation localtime.c strftime.c
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
2004-11-19 15:35:23 +00:00
Axel Dörfler
0db0e9aaa2 KSTACK_SIZE, STACK_SIZE, and MAIN_THREAD_STACK_SIZE were all renamed.
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
2004-11-18 18:15:39 +00:00
Axel Dörfler
b139f2481d Renamed KSTACK_SIZE to KERNEL_STACK_SIZE.
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
2004-11-18 18:11:19 +00:00
Axel Dörfler
8bde4cf98c vm_store::fault() can now decide not to handle the fault - when it returns
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
2004-11-18 18:03:34 +00:00
Axel Dörfler
d55026c2d5 Added empty implementation of mknod() - should be pretty much what BeOS does.
The "mv" command needed it.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-18 16:56:10 +00:00
Axel Dörfler
893e0713fb vm_store::fault() now returns a status_t.
Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-18 14:35:40 +00:00
Axel Dörfler
5d6e6b647c Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-18 04:15:10 +00:00
Axel Dörfler
397e7db6df Brought the userland time initialization into more or less final shape:
- 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
2004-11-18 03:08:36 +00:00
Axel Dörfler
1979c1f90c Page directories are now always allow user read/write access - this reduces
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
2004-11-17 15:51:24 +00:00
Jérôme Duval
7bad53a1bc better parenthesis
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-17 00:22:54 +00:00
Jérôme Duval
b5027c0e2b added ctime_r
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-16 11:24:35 +00:00
Jérôme Duval
b3c1f2c654 removed comments
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-16 00:37:26 +00:00
Axel Dörfler
abb0fbc167 vfs_mount_boot_file_system() now at least checks for the right partition
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
2004-11-15 20:02:04 +00:00
Axel Dörfler
06db250916 vfs_mount_boot_file_system() now also gets the kernel_args.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9964 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-15 20:00:49 +00:00
Axel Dörfler
17e0266f6e Implemented platform_register_boot_device(): it parses drive_parameters
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
2004-11-15 18:11:27 +00:00
Axel Dörfler
04b9d56a03 register_boot_file_system() now also fills in the kernel_args data about
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
2004-11-15 18:06:47 +00:00
Axel Dörfler
925f2cab6a get_node_for() has moved into the public VFS API for now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-15 18:05:01 +00:00
Axel Dörfler
5d6160d04e panic() now reboots when you press a key.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9959 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-15 18:03:56 +00:00
Axel Dörfler
356f4957fa Added a function that clears the keyboard buffer.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9958 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-15 18:02:50 +00:00
Axel Dörfler
8a4b1da1e7 Corrected the information where the real/protected mode stacks begin; the
comment did not take the BIOS data area into account.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9957 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-15 18:01:52 +00:00
Axel Dörfler
0084d31635 Added an additional flags parameter to fs_mount(), "args" is now a const char.
Turned off debugging output in pipefs.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-15 16:43:30 +00:00
Axel Dörfler
ead0d79064 Debug output now uses the TRACE() macro, turned debug output off.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-12 17:21:14 +00:00