Commit Graph

1818 Commits

Author SHA1 Message Date
Ingo Weinhold 90ade5e298 * Added file_system_module_info::uninitialize() analogously to
partition_module_info::uninitialize().
* Implemented the hook for BFS.
* Implemented KFileSystem::Uninitialize().

Fixes failure to initialize a BFS initialized device with an intel partition
map.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42142 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-13 01:53:11 +00:00
Ingo Weinhold 0b7fe5cbe2 partition_module_info::uninitialize(): Added block size parameter for
convenience.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42141 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-13 01:38:03 +00:00
Ingo Weinhold 285f4cf441 * Added optional partition_module_info::uninitialize() hook. It is supposed to
destroy the partitioning system's on-disk structure.
* Adjusted the existing partitioning system implementations accordingly.
  Actually implemented the hook for the intel partitioning system.
* Added Uninitialize() method to KDiskSystem and KPartitioningSystem. The latter
  implements the method calling the new module hook.
* _user_uninitialize_partition(): Also let the disk system uninitialize the
  on-disk structure.

This fixes the failure to initialize a disk device with BFS, when it contains a
valid partition map with at least one partition.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42140 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-13 01:27:13 +00:00
Ingo Weinhold 5e78920c12 * Added platform_debug_get_log_buffer() which returns the debug log buffer and
its size.
* Added "Display current boot loader log" item to the "Debug Options" boot
  loader menu. It displays what the boot loader has logged so far. Might be
  interesting for early boot issues when serial debugging is not possible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-12 23:31:57 +00:00
Rene Gollent 73df2f2086 * Add validation of the RSDP checksums.
* If we detect ACPI 2.0 or higher, the spec says we should use the XSDT rather
  than the RSDT. Attempt to do so, falling back to the RSDT if the former fails
  to be mapped/validated.
* Refactored acpi_find_table into a templated version to account for the fact
  that the XSDT exports different pointer widths for its links to other tables
  than the RSDT.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-12 22:01:43 +00:00
Rene Gollent e8d73efc9c Should have been part of previous commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42130 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-12 20:18:01 +00:00
Ingo Weinhold 8bcc50c336 * Added arch_debug_blue_screen_try_getchar() and arch_debug_serial_try_getchar()
which don't wait for a character, but return -1 when no character is
  available ATM. Implemented correctly for x86 only.
* Changed the semantics of the debugger_module_info::debugger_getchar() hook.
  It is supposed to return immediately now.
* Adjusted usb_keyboard accordingly. Hacked UHCI's debug_process_transfer() to
  achieve that. It does now start, check, or cancel a transfer. Split
  UHCI::ProcessDebugTransfer() into StartDebugTransfer(), and
  CheckDebugTransfer() accordingly, and also added a CancelDebugTransfer().
  The latter seems to have issues. Michael, please have a look. I have no clue
  what I'm doing. :-)
* Adjusted kgetc() to poll all possible inputs using the new
  functions/semantics. This allows to use any input (USB, PS/2, serial) in KDL.
* Removed the no longer needed "serial_input" command.
* read_line(): Also support 0x7f as backspace code. That's what xterm sends.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42126 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-12 17:15:42 +00:00
Rene Gollent 6b0007fb77 Rename rsdt_length to xsdt_length to avoid future confusion.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-12 02:12:07 +00:00
Ingo Weinhold 24df65921b Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
  handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
  support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
  of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
  [set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-12 00:00:23 +00:00
bonefish ea71d6eb4f Made Remove() safe to be called with an element not in the list and changed its
return type to bool to indicate whether it was.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42096 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-11 13:02:41 +00:00
Ingo Weinhold 9536ec0297 Reimplemented the gdb stub support for the 'g' command (read registers):
* Added an arch_debug_gdb_get_registers() interface that is supposed to provide
  the register values in the format expected by gdb and implemented it for x86.
* Reimplemented gdb_regreply() to use that. Also made it buffer overflow safe.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-03 15:35:10 +00:00
Jérôme Duval 6ec9dff3f3 ppc build fix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41834 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-30 19:51:45 +00:00
Rene Gollent 8837310ce7 * Slightly alter the semantics of the input gathering function to take the
menu item it's associated with rather than an input string. This allows it
  to calculate the position to start the input at, as well as the correct
  line to place it on. The previous solution always put the input at the
  center line, which happened to be the right place by happy coincidence
  unless one also had the menu items for viewing/saving the debug syslog
  present.
* Implement input buffer scrolling, and consequently lift the previous size
  limit on user input (it is now only limited by the size of the passed in
  buffer).
* Implement parsing of the input buffer to allow it to handle comma-separated
  options. Thus, one can now input things like "disable_smp true, serial_debug_output false"
  and it will be handled properly.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41706 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-24 03:21:51 +00:00
Rene Gollent d2b49a0031 * Implement support for user input of additional safe mode options that
aren't otherwise exposed via the safe mode menus. The option can be 
found under the debug options menu, where additional settings can be 
added one at a time with the same syntax used in kernel settings files 
(i.e. disable_acpi on). 

Scrolling of the input buffer is not yet supported (will implement that 
soon), so currently the input is clamped to the size of one line. This 
shouldn't be a problem for our current set of options though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-19 01:38:02 +00:00
Michael Lotz fb5a1727f4 * Implement interrupt source overrides. We install a relay interrupt handler
at the override entry to trigger the overriden vector so that we don't need
  to configure any additional redirections.
* Also configures the polarity and trigger modes found in the override entry.
* When disabling the legacy PIC, retrieve the enabled interrupts and re-enable
  then in the IO-APIC. This will for example make the ACPI SCI work that is
  installed prior to switching interrupt models. Through the transparent support
  for interrupt source overrides it'll also automatically relay from the old to
  the new vector.

This should make ACPI interrupts work and should support relocating the ISA PIT
from irq 0 to a different global system interrupt (usually 2) so that it can
still work when IO-APICs are in use.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 12:57:40 +00:00
Matt Madia 502fc780bf Updated the header files for the boot splash, to display the registered
trademark symbol.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41499 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-14 18:59:26 +00:00
Michael Lotz 8908aef9c2 * Don't map the IO-APIC within the bootloader. We don't need it to set up SMP
at all and, since there can be multiple IO-APICs, we need to do the
  enumeration again in the kernel anyway. Also only set ioapic_phys the first
  time we encounter an IO-APIC object as it looks cleaner when we arrive at the
  first IO-APIC default address.
* Therefore we don't have to worry about already mapped IO-APICs when
  enumerating them in the kernel.
* Also remove the mapping function that is now not used anymore.
* We still use the ioapic_phys field of the kernel args to determine whether
  there is an IO-APIC at all to avoid needlessly doing the enumeration again.

This fixes multi IO-APIC configurations, because before we would indeed map
the last IO-APIC listed in the MADT, but then in the kernel assumed we mapped
the first one. We'd end up with mapping the last listed IO-APIC twice and the
first IO-APIC never, always programming the last one when we actually targetted
the first one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-13 16:31:31 +00:00
Michael Lotz a56cbb2afb * When initializing MSI support, don't assume a single 24 entry IO-APIC. Instead
mark the ISA interrupts as unusable and then use ioapic_is_interrupt_available
  to determine if that vector is possibly taken by an IO-APIC. If IO-APICs are
  not used, this will simply always return false, leaving all vectors free for
  MSI use.
* The msi_init() now has to be done after a potential IO-APIC init, so it is now
  done after ioapic_init() instead of inside apic_init().
* Add apic_disable_local_ints() to clear the local ints on the local APIC once
  we are in APIC mode (i.e. the IO-APIC is set up and we don't need the external
  routing anymore).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 18:05:05 +00:00
Michael Lotz 20537052a2 Quick build fix for the FreeBSD compatibility layer. Maybe the definition should
be moved to a (even) more private header?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41427 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 01:30:55 +00:00
Michael Lotz dc14d97b7f * Move the legacy PIC and the IO-APIC code into their own source file. No
functional change intended.
* Use an appropriately sized sLevelTriggeredInterrupts for each controller type.
  This also fixes an out of bound access for IO-APICs with more than 32 entries
  and also returns the right mode in such cases.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41426 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 00:53:03 +00:00
Oliver Tappe 6250297a08 Switch haiku-revision from uint32 to string, as that's going to be required soon, no matter if we switch to Git or Mercurial
* increase _SYS_NAMELEN defined in sys/utsname.h to 128 to allow long(ish) revisions
* sHaikuRevision is now a static character array (in both libroot and kernel)
* adjust build tool set_haiku_revision to write the revision as string


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-08 20:02:42 +00:00
Ithamar R. Adema e59aab0981 ARM: Some header cleanup in preperation of more CPU support code...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-14 13:48:21 +00:00
Jérôme Duval 245df7abd3 added exFAT partition type
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40410 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-09 20:30:00 +00:00
Oliver Tappe 137c5fe2ba * add implementation of bindfs, which can be used to bind-mount
a folder to some other place in the filesystem hierarchy
* add helper function to VFS that encapsulates the "conversion" of a
  vnode-pointer to a fs_vnode-pointer (used by bindfs)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-16 16:33:11 +00:00
François Revol 8dfd99a91c Build fix for r40196. Should now be back to previous state (breaks at vm stuff).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-13 12:29:15 +00:00
Philippe Houdoin 67938b0d59 Switched boot splash compression to use boot_zlib (which was already
used by tarfs anyway) instead of RLE.
While this should allows larger logo/icons, it doesn't remove the
current 300000 bytes size limits for haiku_loader, so #6710 is not yet fixed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-12 15:43:14 +00:00
Ingo Weinhold 4535495d80 Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
  respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
  private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-10 21:54:38 +00:00
Ingo Weinhold 0536ff83e9 * IS_KERNEL_ADDRESS(): Avoid the check against KERNEL_BASE or KERNEL_TOP, if
that's the limit of the addr_t domain anyway.
* Defined IS_USER_ADDRESS() to !IS_KERNEL_ADDRESS(), which semantically it was
  already, just more verbosely.

Should, in the future, avoid hundreds of useless Coverity tickets where the
macros are used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40093 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-03 17:56:04 +00:00
Ingo Weinhold a0d93d1416 * VMCache::Unlock(): Renamed local variable consumerLocked to avoid shadowing
the parameter (CID 5329).
* _MergeWithOnlyConsumer(): Removed the somewhat weird consumerLocked
  parameter. The caller can unlock itself, if desired. Improves Unlock()
  readability.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40084 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-03 00:44:40 +00:00
Oliver Tappe db03311342 Closing #7056:
* inherit umask of calling process to images loaded via exec...()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 19:12:19 +00:00
Ingo Weinhold d23cadce4c [_{kern,user}_]{start,stop}_system_watching()
-> [_{kern,user}_]{start,stop}_watching_system()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39872 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 17:01:23 +00:00
Ingo Weinhold 88e38c178a Replace uses of obsolescent BReference[able] API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 14:29:37 +00:00
Ingo Weinhold d2bf328d72 Implemented a generic system watching mechanism with a userland API. Currently
only a few events can be watched (team creation/deletion/exec, thread creation/
deletion/name changes). The functions start_system_watching()/
stop_system_watching start/stop watching events.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 01:49:52 +00:00
Ingo Weinhold 4ebc8f615d * Added a "name changed" notification to the thread notification service.
* Added a "team" field to the notification events.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39861 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 01:44:15 +00:00
Ingo Weinhold 2d8d1cdbaa * Implemented a generic way to associate data with a team which is
automatically cleaned up when the team is deleted: Class AssociatedData is
  the base class for a data item, AssociatedDataOwner a container for them
  (struct team derives from it). Functions team_associate_data() and
  team_dissociate_data() add/remove data.
* Turned sTeamHash into a BOpenHashTable (necessary since struct team is no
  longer a POD).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39860 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 01:15:35 +00:00
Ingo Weinhold eeecbf6fb8 The header is no longer included from pure C sources, so we can finally freely
use C++.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39859 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-15 23:18:13 +00:00
Rene Gollent 27a115f668 Revert r39846 and r39847.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39849 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-14 17:55:38 +00:00
Rene Gollent 7040b50df5 Add support for thread rename and priority change notifications to the
debugger API/message set.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39846 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-14 05:08:47 +00:00
Ingo Weinhold 07655104d5 Eliminated _acquire_spinlock(). Since the macro is defined after
acquire_spinlock_inline(), there's actually no undesired recursion.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39647 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-26 13:55:20 +00:00
Ingo Weinhold c07db2ec3f * elf_find_symbol(): Skip undefined symbols and symbols with the wrong binding.
* Implemented missing handling of symbolically linked images and of weak
  symbols.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-26 13:32:24 +00:00
Ingo Weinhold 56d734a1aa Added new private API to get more information on a team:
* Userland interface: get_extended_team_info().
* Syscall: _kern_get_extended_team_info.

Only partially implemented yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-16 19:42:08 +00:00
Ingo Weinhold 5609b854b5 Added a Remove() version to which the previous element needs to be passed as
well. This is rather ugly, but it was the quickest way to provide O(1) element
removal. This class could really use some love.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39296 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 14:58:10 +00:00
Ithamar R. Adema c917cd6261 * ARM: Major VM work
- This is mostly a copy of the x86 32bit paging method and infrastructure, this was copied for two reasons:
		1) It is the most complete VM arch
		2) The first ARM PAE patches have landed on alkml, so we will have to deal with it in the future as well,
		   and this infrastructure has proven to be ready ;)
	- No protection features, or dirty/accessed tracking yet
	- Lots of #if 0

	but....

	It boots all the way up to init_modules() now, and then dies because of a lack of (ARM) ELF relocation implementation!

	Since at this point the VM can be fully initialised, I'm going to focus on CPU exceptions next, so we can get KDL to trigger
	when it happens, and I can actually debug from there ;)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 14:10:30 +00:00
Ithamar R. Adema 107ce9b0fb * ARM: Remove fields that were no longer used since r39168...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39205 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 13:57:32 +00:00
Ingo Weinhold 13b81a3b8e * Added new thread flag THREAD_FLAGS_SINGLE_STEP, which is set to indicate that
userland single-stepping is enabled for the thread.
* x86_exit_user_debug_at_kernel_entry(): Always store DR6 and DR7 in the CPU
  structure, not only when breakpoints are installed.
* x86_handle_debug_exception(): When encountering a syscall single-step, also
  set the THREAD_FLAGS_DEBUG_THREAD thread flag. Otherwise the
  B_THREAD_DEBUG_STOP would be ignored.
* x86 interrupt handling, DISABLE_BREAKPOINTS():
  - Renamed to STOP_USER_DEBUGGING().
  - Now it also call x86_exit_user_debug_at_kernel_entry() when
    THREAD_FLAGS_SINGLE_STEP is set, so that the debug registers are saved.

Fixes #6751.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39201 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 11:31:01 +00:00
François Revol c489b073c8 Partial build fix. Still a lot to do to catch up with Ingo...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 01:33:50 +00:00
Ithamar R. Adema d38153721e * Add page directory/table helper macros.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39137 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-25 11:16:21 +00:00
Ithamar R. Adema 2609a6bc98 * Fix header guard.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 22:06:22 +00:00
François Revol c8afe2ca9b Fix header guard which prevented from including text_console.h along with this one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-23 19:08:52 +00:00
Fredrik Holmqvist f55ffb1a8e Completed structures for MADT APIC structures. I may now have a Frankenheimer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-23 15:49:17 +00:00