Commit Graph

2277 Commits

Author SHA1 Message Date
hyche
e715614613 AVLTree: forward LeftMost and RightMost method from AVLTreeBase
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-12-10 10:56:08 -05:00
Augustin Cavalier
bf77c15232 kernel/vm: Correct virtual function declarations.
The base VMCache class changed to the generic_ types with their
introduction in in *2011* (435c43f591),
but these classes were never properly adapted. These functions should not
be called here (they panic() -- but the base class only returns B_ERROR,
so that is a difference at least.)

Found by Clang's -Woverloaded-virtual.
2017-12-02 21:42:50 -05:00
Augustin Cavalier
30c9d3c0cc kernel: Correct class/struct mixups.
Almost certainly harmless. Spotted by Clang.
2017-12-01 20:27:15 -05:00
Alexander von Gluck IV
a42249db2d arm: Add 8250 omap variant uart driver
* Untested, someone with an omap3,4,5 could though.
2017-11-20 09:16:58 -06:00
Andreas Faerber
ce6fdd33ef Detach UDP sockets on cleanup
The UDP service does not own the UDP sockets. When shutting down,
inform the bound sockets that the service is no longer available.
This allows subsequent method calls to error out cleanly.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-11-13 16:48:09 +01:00
Andreas Faerber
74077e46e1 Add net_stack_cleanup()
Add a cleanup function net_stack_cleanup() that calls a new NetStack::ShutDown() method.
Make sure this method works even if the network stack was never initialized.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-11-13 16:47:27 +01:00
Jérôme Duval
a295d3f46e wait4(): retrieve dead team entries usage information.
* This adds a parameter to the wait_for_child syscall. I extended the test case
to show the actual retrieved information.
* fix #13546
2017-10-10 17:20:46 +02:00
Adrien Destugues
f0f458ebea Remove glow from boot logo.
It looks better without it.
Note: beta and "development" images not adjusted. We don't have the
wonderbrush sources in the repo for these, apparently.
2017-07-29 12:27:50 +02:00
hyche
9f9ba0bdc1 btrfs_shell: Support AVLTree 2017-07-25 09:34:46 +07:00
Alexander von Gluck IV
0cc293cf32 raspberrypi_arm: Drop old Raspberry Pi 1 boot loader.
* We transitioned to u-boot quite some time ago
* We also are dropping < ARMv7 support
2017-07-11 14:39:13 -05:00
Alexander von Gluck IV
f642e558e8 arm: Drop board_config headers 2017-07-10 15:13:49 -05:00
Alexander von Gluck IV
855fc5a0d3 platform/u-boot: Build all fdt's and include in u-boot mmc
* Eventually BoardSetups and target boards will go away.
* Include all known fdt's in the mmc image
* This gets us closer to target board-less arm
* Changing hardware is as simple as plugging a new fdt
  into u-boot's startup script.
* Drop my original rpi1 work.  We're targetting ARMv7
  minimum.
2017-07-09 22:19:51 -05:00
Alexander von Gluck IV
49a2540f47 ppc/atomic.h: Readd arch atomic improperly removed in hrev51254 2017-07-03 09:55:51 -05:00
Alexander von Gluck IV
9c8119e02c kernel/smp: Add a comment for some obsecure knowledge
* I was ready to rip this out until PulkoMandy set me stright.
* Add a comment so others understand the impact here.
2017-07-03 09:43:07 -05:00
Alexander von Gluck IV
913d4886fe kernel/arch/ppc: Add missing cpu reference for PAGE_SIZE 2017-07-02 23:01:25 -05:00
Jessica Hamilton
e888217124 loader: fetch all potential boot partitions for boot device.
This allows the loader to skip BFS partitions that don't contain
a bootable system. Useful when you have a BFS data partition that
comes before the system partition when iterated over.

Currently, only the UEFI loader actually returns more than one
possible partition.
2017-05-17 12:51:09 +12:00
Axel Dörfler
e9843da357 KPath: Added LAZY_ALLOC flag.
* This allows KPath to not allocate a buffer when initialized
  without path.
* Added test cases for this.
* Added test for LockBuffer().
* Enhanced tests to allow building them in debug mode.
* Moved calling vfs_normalize_path() into own private method.
* Improved error codes; B_NO_MEMORY is now only returned if the
  allocation actually failed.
* If used with LAZY_ALLOC, Path() and LockBuffer() are now allowed
  to return a NULL path.
2017-04-30 17:14:45 +02:00
Axel Dörfler
eac83fb33e KPath: Replaced booleans with flags field.
* No functional change intended; I chose the flags in a way that it
  should still work even if I missed a reference.
2017-04-30 17:13:39 +02:00
Axel Dörfler
3582d4fe85 Minor style cleanup. 2017-04-29 14:37:56 +02:00
Augustin Cavalier
b6f76ebe71 s/OpenBeOS License/MIT License/ universally, as they're the same thing.
Fixes #8681.
2017-02-09 22:09:56 -05:00
Jérôme Duval
d0a92cb653 x86: added a MSR definition. 2017-02-01 16:57:03 +01:00
Jessica Hamilton
4419d699ec partitioning: pass along reference to parent when uninitializing.
* Fixes problems with setting the partition name after uninitializing
  a partition in DriveSetup. Previously, UninitializeJob() was
  followed by SetStringJob(), but the kernel was updating the
  change counter for the parent partition when uninitializing a
  partition, leading to SetStringJob() having an incorrect change
  counter for the parent partition. Now the parent change counter
  will be correct when SetStringJob() runs.
2016-12-23 18:53:15 +13:00
Jessica Hamilton
f4ff9cb02c Merge branch 'uefi-support' 2016-11-14 03:21:59 +13:00
Jessica Hamilton
6e6efaecdc EFI: add ACPI support
Also add support in the kernel to get the ACPI RSDP from the
bootloader, and pass onto the ACPI driver using get_boot_item.
2016-11-14 03:21:36 +13:00
Henry Harrington
82dcc31606 bootloader: Translate kernel args before adding them to kernel_args_range.
Chunks may be physically contiguous, but virtually disjoint. Adding
physical addresses may cause ranges to be merged incorrectly.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2016-11-14 01:00:00 +13:00
Alexander von Gluck IV
b2bdabc797 arm: Add beaglebone target, rename beagle
* beaglebone vs beagleboard
* While the boards are almost the same, they have
  diff. FDT's now (more memory, different layout etc)
* Make u-boot script more rpi-like
  (depend on u-boot for initial addresses)
* Wasn't working, still doesn't.
2016-10-20 11:05:46 -05:00
Adrien Destugues
af0282f91f Make US-english the default KDL keymap again. 2016-10-10 07:18:12 +02:00
S K
fe2557b6eb PS/2: fix warnings, enable -Werror
- elantech: Remove unused variables and functions.
- "movement maker": float/int confusions
- debugger keymap: don't use multi-byte chars in preprocessor to avoid
  warnings with gcc2 (even with -Wno-multichar)

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Fixes #12658
2016-10-09 21:11:55 +02:00
François Revol
495efc382b loader: Drop the HashMap for partition lookup by id
The HashMap constructor was called before the heap is initialized,
ending up calling malloc from the OpenHashMap constructor.

Oddly it was still working on x86 but broke other platforms.

Instead we add a Lookup() static method to Partition,
which by default walks gPartitions for the id,
and recursively calls itself on the children lists.

This means we must add a partition even temporarily to gPartitions
before Scan()ing it though.

Signed-off-by: François Revol <revol@free.fr>
2016-09-02 19:02:33 +12:00
Fredrik Holmqvist
211483cb51 EFI: Initial test EFI application
* Only set HAIKU_BOOT_PLATFORM to bios_ia32 if not defined
* Add gnuefi build feature
* Introduce BOOT_LDFLAGS, and move options for passing to linker
  into ArchitectureSetup
* x86_64 compile fixes for warnings in boot loader
* loader/elf.cpp: don't include ELF32 support when targeting EFI
* relocation_func.cpp: copy of the relocation code from gnuefi
  to make _relocate extern "C", and avoid including <efilib.h>
* boot_loader_efi.ld: copy of gnuefi's elf_x86_64_efi.lds,
  modified to include support for C++ constructors, etc. Keep in
  sync with the gnuefi package

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2016-09-02 19:02:29 +12:00
François Revol
02283e080c M68K: drop the custom C arch_cpu_user_mem*() for the default impl
I didn't notice there was a C++ version that didn't require writing asm.

I'll have to write them anyway for speed someday.
2016-07-20 21:57:19 +02:00
François Revol
d26fd5f68d M68K: drop the platform_type field, the enum is gone from OS.h 2016-07-20 20:31:14 +02:00
François Revol
990d34efdd M68K: add arch_cpu_idle and arch_cpu_pause inline stubs
Remove the stub from arch_cpu.cpp

We might want to implement a 040 CPU module providing idle using LPSTOP.
2016-07-20 20:26:29 +02:00
François Revol
7ab9993a18 M68K: Add missing defines
No idea for cache level.

On 030 and 040 a cache line is 16 bytes.
2016-07-20 20:26:29 +02:00
François Revol
3805f72225 M68K: add arch_atomic.h 2016-07-20 20:26:29 +02:00
Ingo Weinhold
90f571868e kernel: Add elf_read_kernel_image_symbols()
Refactor new function out of _user_read_kernel_image_symbols(). Can be
used to get a kernel image's symbols from within the kernel as well.
2016-05-22 22:10:47 +02:00
Ingo Weinhold
8c6cb8af01 runtime loader: Register extended image info with kernel
Add structure extended_image_info which extends image_info by the
fields symbol_table, symbol_hash, string_table.
2016-04-27 02:16:09 +02:00
Ingo Weinhold
467fe4ca0c kernel: Add core dump facility
* Add function core_dump_write_core_file(). It writes a core file for
  the current thread's team. The file format is similar to that of
  other OSs (i.e. ELF with PT_LOAD segments and a PT_NOTE segment), but
  most of the notes are Haiku specific (infos for team, areas, images,
  threads). More data will probably need to be added.
* Add team flag TEAM_FLAG_DUMP_CORE, thread flag
  THREAD_FLAGS_TRAP_FOR_CORE_DUMP, and Team property coreDumpCondition,
  a condition variable available while a core dump is progress. A
  thread that finds its flag THREAD_FLAGS_TRAP_FOR_CORE_DUMP set before
  exiting the kernel to userland calls core_dump_trap_thread(), which
  blocks on the condition variable until the core dump has finished. We
  need the team's threads to stop so we can get their CPU state (and
  have a generally unchanging team state while writing the core file).
* Add user debugger message B_DEBUG_WRITE_CORE_FILE. It causes
  core_dump_write_core_file() to be called for the team.
* Dumping core as an immediate effect of a terminal signal has not been
  implemented yet, but that should be fairly straight forward.
2016-04-24 18:22:14 +02:00
Ingo Weinhold
ac1f1a926e kernel: +image_iterate_through_team_images()
Like image_iterate_through_images(), but iterates though the images of
the given team only.
2016-04-24 17:30:52 +02:00
Ingo Weinhold
99f00556a4 kernel: +arch_get_thread_debug_cpu_state()
Similar to arch_get_debug_cpu_state(), but the thread whose CPU state
to retrieve is specified. Works only for threads that aren't running,
and on x86-64 we can get the FPU state only when the thread was
interrupted in userland.
Not implemented for the incomplete architecture ports.
2016-04-24 17:29:28 +02:00
Ingo Weinhold
7a187cd629 _user_debug_thread(): Use new signal SIGNAL_DEBUG_THREAD
This resolves a TODO: We used thread_interrupt() to wake up the thread
from an interruptable wait. However, if the thread was already in the
kernel and about to start waiting, that would have no effect and the
thread would wait anyway. Now there's the new non-blockable signal
SIGNAL_DEBUG_THREAD, which is sent to the thread instead, making sure
that thread doesn't start waiting.
2016-04-24 11:54:17 +02:00
Alexander von Gluck IV
e54df51727 x86/kernel: Up kernel max page table to 16
* New Intel SkyLake seems to have 9 mapped ranges
  at boot.  It seems like this define has been creeping
  up for a while.
* Resolves the inital issue reported in #11377 on SkyLake
  as well. Bonefish mentioned it might need to be raised
  again... he had some good foresight there :-)
* I'm seeing the same no bootable partitions issue though
  via USB after this raise. (maybe a USB 3.1 thing?)
2016-04-22 19:05:19 -05:00
Axel Dörfler
67988f501a NodeMonitor: Resolve mount points for B_WATCH_CHILDREN.
* When a watched directory contains a mount point, we need to resolve
  the actual parent directory of the mount point in the file system to
  serve the monitor.
2016-03-28 14:31:27 +02:00
François Revol
14cfccd011 U-Boot: add a 'physical' arg to fdt_get_device_reg()
If false, try to use the virtual-reg property first.
2016-02-26 22:58:17 +01:00
Jérôme Duval
7ccbb2f03f Add operator delete(void *, size_t) for C++14. 2015-11-08 00:38:20 +01:00
Jonathan Schleifer
617793f41b Add back declarations to kernel_cpp.h for GCC
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
2015-11-07 20:53:13 +01:00
Jonathan Schleifer
71e0324992
Move new / delete kernel_cpp.h -> kernel_cpp.cpp
new and delete may not be defined as inline, as Clang loudly complains.
The same is true for static.
2015-11-07 18:16:23 +01:00
Simon South
75c31ae28d system: Build using public elf.h header
Reduce duplication of code by

* Removing from elf_common.h definitions available in os/kernel/elf.h
* Deleting elf32.h and elf64.h
* Renaming elf_common.h to elf_private.h
* Updating source to build using public and private ELF header files
  together

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2015-11-07 11:49:56 +13:00
Axel Dörfler
6adf7a0c75 VFS: prevent FD inheritance for the kernel completely.
* Each io_context now has a "inherit_fds" member that decides whether
  or not this context allows to inherit FDs to its children.
* This replaces the former O_CLOEXEC mechanism.
2015-09-11 17:08:35 +02:00
Michael Lotz
5d4501aa01 Assorted whitespace cleanup and typo fixes. 2015-08-20 21:54:41 +02:00