Commit Graph

2640 Commits

Author SHA1 Message Date
Axel Dörfler
260e077ff7 * Registering a file device now also normalizes the path now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:49:52 +00:00
François Revol
5ad3245c2b Timer & RTC code
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28061 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:24:09 +00:00
François Revol
1fa01fe47a Fix the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28060 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:23:14 +00:00
François Revol
5088b34272 Code to read and write the RTC, copied from the x86 version.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28056 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:04:49 +00:00
Axel Dörfler
38bbc95758 * Made the use of file devices more convenient and complete by adding
the methods IsFile() and GetFilePath() to BDiskDevice, and
  BDiskDeviceRoster::GetFileDeviceForPath().
* Added new syscalls to implement this functionality.
* Added new flag B_DISK_DEVICE_IS_FILE.
* Fixed wrong operator precedence assumption in the BDiskDevice class at
  several places.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 21:51:43 +00:00
Axel Dörfler
25174582be Fixed two problems recently introduced by korli and found by aldeck:
* When invalidating unused settings, we should remove the handle from the list
  before freeing it, or else the settings list will be corrupted.
* We should protect the safemode settings against being removed, or else they
  won't be availabe anymore after we mounted the boot device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 13:38:01 +00:00
François Revol
7d49488b80 - cleanup
- remove dead ppc code
- add support for probing hardware registers the way linux does (early, hook with VBR to trap faults)
- detect MFPs this way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 12:56:16 +00:00
Michael Lotz
ecb3d008d6 If a device reports no media is present, don't try to get the geometry anyway.
This confused some USB card readers, that would stop working if you still
requested the geometry when they reported no media.
Note the case that the B_GET_MEDIA_STATUS fails (because it's not implemented or
an error occured) is still handeld in _GetMediaStatus() and then we still try to
get the geometry to check for media presence.
This should fix that some USB card readers wouldn't work and should also remove
the wrongly reported size in DriveSetup for CD drives that don't actually contain
a media.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28029 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 12:34:44 +00:00
François Revol
9f5e12b6b3 - use asm_def.h and FUNCTION_END
- remove some dead ppc code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28023 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 09:25:13 +00:00
Axel Dörfler
1fdc8a49aa * Factored out the demangled function call dump to a print_demangled_call().
* The stack_trace() command now also uses this call by default to give you
  the arguments to all functions in a stack crawl (beware of templates for now,
  though).
* Use the new option '-d' to disable the demangling. You can now also specify
  '-d' in the "call" command which has the same meaning there.
* NULL pointers are now printed as "NULL", and NULL strings are printed as
  well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28019 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 01:39:03 +00:00
Axel Dörfler
ddecb4a7da * Changed the way the demangle functionality works: instead of having a kernel
debugger add-on set a demangle hook, all modules under debugger/demangle/ are
  now considered demangle modules.
* Added another function to the demangle module interface that gives you access
  to the arguments.
* Implemented a demangling module for GCC2.
* The older demangling module is now called "gcc3+", but doesn't support
  getting the arguments yet.
* The "call" KDL command is now using demangling to automatically show you
  the arguments of a call from a stack crawl.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 23:50:41 +00:00
François Revol
94b1f00114 - init PIC earlier
- stub out RTC


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28016 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 23:33:11 +00:00
François Revol
fd630a4552 Might work better with the interrupt handler... I should go to bed now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 22:52:51 +00:00
François Revol
e673981e7e Add support for using the MFP0 timer A. Not calibrated though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 22:43:45 +00:00
François Revol
feec0dd969 Fix ifdef, should be DEBUG_PAGE_QUEUE there.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 21:35:49 +00:00
François Revol
33fa38c894 Avoid using the first physical page. The first 2kB are supposedly protected by the hardware (though it should be accessible by supervisor...) This fixes an segfault.
Now the kernel panics in M68KAtari::InitTimer()... "WRITEME" :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 21:34:31 +00:00
François Revol
c87d34624e Fix identifying iframes in stack_traces. What you get copying ppc code without trying to understand :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 21:23:04 +00:00
Axel Dörfler
4a4abaf25f mmlr:
* Actually call prepare_sleep_state() instead of calling enter_sleep_state()
  twice...
* Commented out disabling interrupts when calling enter_sleep_state(), as our
  ACPI modules would then crash (needs memory & uses sems with interrupts
  disabled). This way, it at least works on some hardware, including emulators
  (as before).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 19:59:51 +00:00
Axel Dörfler
e1ca73e1f1 * do_iterative_fd_io_iterate() must check for B_BUFFER_OVERFLOW to handle the
case it has to call the file map translation hook again to fulfill the whole
  request; it already handled the partial case correctly.
* This fixes an occasional "Value too large" error when accesssing fragmented
  files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 19:14:55 +00:00
François Revol
5222f12a32 - Add m68k pendant of: r27529 & r27778 - handle skipIframes parameter
r27530 - allow faults with ints disabled if there is a handler
r27648 - call the end-of-interrupt thread callback
r27718 - add <asm_defs.h>, not used yet
r27722 - register the commpage as image and symbols (but we don't use it yet)
- remove dupped call to thread_get_current_thread()
- use 16MB iospace for now, 4MB seems too small.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 18:13:11 +00:00
François Revol
5bb2204e46 Enable and fix the asm memcpy(). It's far from optimized, but works now and fixes the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 18:07:47 +00:00
Ingo Weinhold
c73aeac11e We need to let the runtime loader call shared object termination hooks
from exit().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 12:26:27 +00:00
Axel Dörfler
5c2e513005 * The device manager must use kprintf() when printing out stuff in the KDL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 00:03:05 +00:00
François Revol
6a6efce864 10000l for Ingo for having me spend hours spotting this funny typo!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27981 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 21:47:00 +00:00
Ingo Weinhold
1b6eff280f * Replaced the vm_get_physical_page() "flags"
PHYSICAL_PAGE_{NO,CAN}_WAIT into an actual flag
  PHYSICAL_PAGE_DONT_WAIT.
* Pass the flags through to the chunk mapper callback.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27979 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 20:55:32 +00:00
Ingo Weinhold
5e50de7e2e Don't disable interrupts in flush_tmap() and map_iospace_chunk(), just
pin the thread to the current CPU.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 18:12:10 +00:00
Ingo Weinhold
6503e5d9c6 Added functions to pin a thread to the current CPU (i.e. it will only be
scheduled on that CPU) and to avoid unscheduling it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 18:11:12 +00:00
Ingo Weinhold
d654f56af2 * Added kernel tracing for the page daemon and the page writer.
* Added some commented out debug output in vm.cpp. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27971 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 15:17:12 +00:00
Jérôme Duval
3c4a3ce31c * correctly init ref_count on driver settings handles
* unload settings when ref_count is zero and boot device is available


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 14:58:12 +00:00
François Revol
85f9771aec Avoid crashing if gccPlatform is NULL, thanks Axel!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27968 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 08:41:54 +00:00
Ingo Weinhold
4eaa43ac48 * Added "flags" parameter to VMCache::Read().
* Use the new VMCache::Read() flags parameter to directly read into the
  physical page in the page fault handler instead of mapping it first.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 07:30:44 +00:00
Axel Dörfler
2716cfd3d7 * Threw away the broken stat() vs. _stat() mechanism to allow for more fields
in struct stat.
* Instead, I followed Marcus' great idea and added a compatibility check in
  the runtime loader: now, R5 binaries (also shared libraries) are detected,
  and they get special versions for stat(), fstat(), and lstat() that return
  the smaller stat struct.
* However, I've disabled (in src/system/libroot/posix/sys/stat.c) using the
  larger stat field for now, as this breaks some of our optional packages.
  So until we rebuild them all, this shouldn't be enabled.
* This should now also be used for BeOS compatibility in libnetwork.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 22:13:05 +00:00
Ingo Weinhold
1b3b00c2a1 memset() returned the wrong value. Fascinatingly there's even software
(APR) that uses it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 21:49:03 +00:00
Ingo Weinhold
78594e1f21 Save one byte of code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27959 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 20:07:08 +00:00
Ingo Weinhold
b18c9b97ae * Implemented x86 assembly version of memset().
* memset() is now available through the commpage.
* CPU modules can provide a model-optimized memset().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27952 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 18:43:46 +00:00
Ingo Weinhold
379ad6d037 * Moved the arch specific stuff in src/system/kernel/lib into arch/...
subdirectories. Also moved the x86 kernel arch_string.S there.
* Moved memcpy.c from src/system/libroot/posix/string into the
  arch/generic subdirectory.
* Dealt with the consequences of moving things around. Affected are also
  the boot loader and runtime loader builds.

Adjust the m68k and ppc parts, too, but only the x86 build is tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 23:47:01 +00:00
Stefano Ceccherini
026c75e91c add ctype-extn.c to the build. It contains the function versions of the is*** defines. Without this, bash 3 refuses to compile on haiku
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27946 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 14:58:45 +00:00
Rene Gollent
aa420f85e2 Added TRACE macros to this file and redid its dprintfs to use that instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 13:41:15 +00:00
François Revol
4129f84603 - add team id on a TRACE()
- try to accomodate for low ram systems by making the first kernel heap allocation smaller


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27943 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 12:11:49 +00:00
François Revol
93861ead3e Better floppy media descriptor for the fake FAT.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 09:50:00 +00:00
Rene Gollent
8b6f1d5ef5 Fixed warnings with tracing enabled and made some very noisy dprintfs trace-only
as they were flooding the syslog.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 03:53:00 +00:00
Ingo Weinhold
7867cf37df Increase the heap size in 64 KB steps. Was 4 KB before, which was a bit
slow for short-running, heap-intensive programs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-08 14:05:47 +00:00
Ingo Weinhold
74785e79db * Added "from" address space parameter to vm_swap_address_space()/
arch_vm_aspace_swap().
* The x86 implementation does now maintain a bit mask per
  vm_translation_map_arch_info indicating on which CPUs the address
  space is active. This allows flush_tmap() to avoid ICI for user
  address spaces when the team isn't currently running on any other CPU.
  In this context ICI is relatively expensive, particularly since we map
  most pages via vm_map_page() and therefore invoke flush_tmap() pretty
  much for every single page.
  This optimization speeds up a "hello world" compilation about 20% on
  my machine (KDEBUG turned off, freshly booted), but interestingly it
  has virtually no effect on the "-j2" haiku build time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 21:39:19 +00:00
Ingo Weinhold
6bbe7eb8ca * smp.c -> smp.cpp
* Added smp_send_multicast_ici(), which sends the message to all CPUs
  specified via a mask.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 21:14:24 +00:00
Ingo Weinhold
3fea1d5918 Simplified x86_next_page_directory().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27904 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 13:08:44 +00:00
Ingo Weinhold
dbe295f827 Moved vm_translation_map_arch_info definition to the header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27902 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 11:49:13 +00:00
Ingo Weinhold
032ff97fbd When a thread times out on a locking primitive, reschedule only, if the
timed out thread has a higher priority than the currently running one.
Maybe we should even restrict this behavior to realtime threads.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-06 23:00:17 +00:00
Axel Dörfler
0555803a41 Applied patch by Romain, thanks!:
* get_nth_symbol() did not correctly iterate over the symbol hash, causing it
  to return the same symbols more than once, and omit others.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-06 21:03:58 +00:00
Ingo Weinhold
dee62ec06b Yay, infinite loop when debug output is disabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-05 15:17:31 +00:00
Ingo Weinhold
57a45758e2 * Fixed several instances of conversions from page to byte counts. We
need to cast explicitly before the multiplication/shift, since the
  former is 32 bit and the latter 64 bit. The worst instance was in
  swap_file_add(), where the page count was int32, so that swap file
  sizes between 2 and 4 GB resulted in a negative available swap space
  size. Fixes bug #2721.
* Fixed and added optional debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27877 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-05 14:37:50 +00:00