Commit Graph

4559 Commits

Author SHA1 Message Date
Pawel Dziepak 6003243ef3 util: introduce kernel utils for pseudorandom number generation
Currently there are two generators. The fast one is the same one the scheduler
is using. The standard one is the same algorithm libroot's rand() uses. Should
there be a need for more cryptographically PRNG MD4 or MD5 might be a good
candidates.
2013-04-11 04:34:59 +02:00
Pawel Dziepak a8f8d2c057 x86_64: put user stack and team data at top of user address space 2013-04-04 20:54:56 +02:00
Pawel Dziepak f697412ff8 vm: place commpage and team data near the top of user address space
Placing commpage and team user data somewhere at the top of the user accessible
virtual address space prevents these areas from conflicting with elf images
that require to be mapped at exact address (in most cases: runtime_loader).
2013-04-04 15:27:24 +02:00
Pawel Dziepak e85e399fd7 commpage: randomize position of commpage
This patch introduces randomization of commpage position. From now on commpage
table contains offsets from begining to of the commpage to the particular
commpage entry. Similary addresses of symbols in ELF memory image "commpage"
are just offsets from the begining of the commpage.

This patch also updates KDL so that commpage entries are recognized and shown
correctly in stack trace. An update of Debugger is yet to be done.
2013-04-04 15:27:22 +02:00
Pawel Dziepak 966f207668 x86: enable data execution prevention
Set execute disable bit for any page that belongs to area with neither
B_EXECUTE_AREA nor B_KERNEL_EXECUTE_AREA set.

In order to take advanage of NX bit in 32 bit protected mode PAE must be
enabled. Thus, from now on it is also enabled when the CPU supports NX bit.

vm_page_fault() takes additional argument which indicates whether page fault
was caused by an illegal instruction fetch.
2013-04-04 15:22:23 +02:00
Pawel Dziepak 211f71325a x86: move x86_userspace_thread_exit() from user stack to commpage
x86_userspace_thread_exit() is a stub originally placed at the bottom of
each thread user stack that ensures any thread invokes exit_thread() upon
returning from its main higher level function.

Putting anything that is expected to be executed on a stack causes problems
when implementing data execution prevention. Code of x86_userspace_thread_exit()
is now moved to commpage which seems to be much more appropriate place for it.
2013-04-04 15:16:27 +02:00
Pawel Dziepak 3b4269ecf5 arch: randomize initial user stack pointer
Inside the page randomization of initial user stack pointer is not only a part
of ASLR implementation but also a performance improvement that helps
eliminating aligned 64 kB data access.

Minimal user stack size is increased to 8 kB in order to ensure that regardless
of initial stack pointer value there is still enough space on stack.
2013-04-04 15:16:20 +02:00
Michael Lotz a9abcc37cd Rework initial auto joining and add big TODOs.
* If we have a configured network, then we always try to connect to it
  as soon as the interface has been brought up.
* If we don't have a configured network and are auto configuring, we
  use the AutoconfigLooper to also do initial auto joins.
* Before issuing auto joins we need to wait for scan results to come
  in, so we watch for corresponding messages.

For now auto joining is a one shot attempt as the infrastructure to
properly tell reasons for scans apart is not yet there.
2013-04-02 04:59:44 +02:00
Alex Smith 5e0c3db286 Account for the physical map area in the kernel VM space. Fixes #9547.
The physical memory map area was not included in the kernel virtual
address space range (it was below KERNEL_BASE). This caused problems
if an I/O operation took place on physical memory mapped there (the
bad address error seen in #9547 was occurring in lock_memory_etc()).
Changed KERNEL_BASE and KERNEL_SIZE to cover the area and add a null
area that covers all of it. Also changed X86VMTranslationMap64Bit to
handle large pages in Query(), as the physical map area uses large
pages.
2013-03-22 18:30:01 +00:00
Axel Dörfler 928001cea9 Further tuned AMD CPU identifier parsing.
* Thanks to a list of 1384 entries with AMD CPU identifiers from Alex.
2013-03-22 09:37:47 +01:00
Axel Dörfler df4d35e837 Added a parse_amd() for CPU identification.
* This parses the reported CPU name, and tries to translate it to a normal
  and concise identifier.
* For example, it will translate "AMD FX(tm)-8320 Eight-core Processor" into
  "FX™ 8320" or "Dual Core AMD Opteron(tm) Processor 275 HE" into
  "Opteron™ 275 HE".
* This means we can remove AMD strings for those models for which this
  function produces useful results.
2013-03-20 21:04:23 +01:00
Alexander von Gluck IV 190423a656 cpu_type: Add model 2 AMD FX CPU 2013-03-20 13:15:28 -05:00
Pawel Dziepak 7f61e6e4e5 Merge branch 'nfs4'
Conflicts:
	build/jam/HaikuImage
2013-03-11 13:00:55 +01:00
Michael Lotz 4a0460a9bc Add generic unlock key setting and removal.
* Replace {Set|Remove}MasterKey() by generic {Set|Remove}UnlockKey()
  that works on a keyring.
* Implement {Set|Remove}MasterUnlockKey() on top of that.
* Rename the commands and constants accrodingly.
* Implement setting and removing keyring unlock keys.
2013-03-05 11:04:57 -05:00
Michael Lotz c8ae843f3d Rename keyring "access/revoke" to "unlock/lock".
The unlock/lock concept just seems easier to grasp and is used in
various similar tools as well.
2013-03-05 11:04:30 -05:00
Michael Lotz 5d4a0da455 Remove unneeded master access revoke command.
Revoking master access currently simply means to revoke access
to the default keyring.
2013-03-05 11:00:03 -05:00
Michael Lotz 005a15bbcd Move keystore message constants and use a messenger.
* The keystore backend will (at least for the time being) reside in a
  separate server. This one can be reached via normal messaging, so use
  a BMessenger for sending key messages.
* Move the message constants from RegistrarDefs.h into a new
  KeyStoreDefs.h that also contains the server signature.
* Update the message constants to reflect the new situation.
2013-03-05 10:59:47 -05:00
Michael Lotz 1c3996496b Implement all KeyStore methods except for password generation.
* Add all relevant message constants.
* Implement the messaging to send/retrieve key info.
* Implement _Flatten/_Unflatten for sending flat BKey objects.
* Remove application list from BKey, the key can't only differ by
  allowed applications as the identifiers would still collide, so the
  comparison isn't needed to uniquely identify the key. The applications
  can be enumerated via the BKeyStore instead.
2013-03-05 10:59:46 -05:00
Tri-Edge AI 49126a0e9b Added ResourceEdit and modified BColumnListView, BRow and BMenu.
Signed-off-by: Matt Madia <mattmadia@gmail.com>
2013-02-27 22:08:46 -05:00
John Scipione 66e9410806 Switch about window to current workspace if hidden. 2013-02-11 21:25:51 -05:00
John Scipione 9f7ac4312a Add methods to get and set the name, version, and icon 2013-02-11 21:17:57 -05:00
Axel Dörfler 443522551e Fixed design issues in BPartitionParameterEditor.
* The user of an editor needed knowledge about the editor in order to make
  use of it.
* Furthermore, the BPartitionParameterEditor exposed type specific
  functionality that it shouldn't know anything about, either.
* We may now define a number of known parameters per editor type; right now
  there is only "type" as it's needed by DriveSetup.
* Adapted all disk systems, and DriveSetup to the new API.
* Renamed CreateParamsPanel, and InitializeParamsPanel to *ParametersPanel
  in DriveSetup.
* They now share a common base class AbstractParametersPanel.
2013-02-02 01:13:19 +01:00
Bill Randle 7d9c1f30f1 radeon_hd: Add Northern Island registers 2013-01-29 12:29:06 -06:00
Bill Randle 7aedc8b3e1 edid_raw: Correct missing bitfield
* edid1_detailed_timing_raw was missing
  a field which threw off the sync bits.
* The result was the monitor will receive
  a different sync polarity than it requested.
  Most monitors handle this, but it is still
  a bug
2013-01-27 12:18:49 -06:00
Axel Dörfler 7f33c9cda3 Lost the "EFI" in front of "GUID Partition Map" name.
* This is how other systems refer to it as well, and is shorter, too.
2013-01-24 01:15:26 +01:00
Fredrik Modéen 34dad10384 Adding debug file to bluetooth.
* more changes will come.
2013-01-12 20:01:28 +01:00
Alexander von Gluck IV a2b448a0c1 intel_extreme: Mark IvyBridge as having a PCH
* Modesetting now works on IvyBridge
* Preferred mode needs work though as my chipset
  defaults to 1024x768 vs 1366x768
2012-12-29 00:09:00 +00:00
Hamish Morrison d1f280c805 Add support for pthread_attr_get/setguardsize()
* Added the aforementioned functions.
* create_area_etc() now takes a guard size parameter.
* The thread_info::stack_base/end range now refers to the usable range
  only.
2012-12-28 18:02:58 +00:00
Alexander von Gluck IV 660ca29ee0 intel_extreme: Add IvyBridge PCIID's
* This needs testing and likely some IvyBridge
  fixups
2012-12-26 11:01:43 -06:00
Rene Gollent 55751d083a Move Tokenizer/Token into ExpressionParser's namespace. 2012-12-18 21:31:43 -05:00
Michael Lotz fd6e3a11e2 Use the existing ARM MMU definitions and remove duplicates. 2012-12-04 23:38:06 +01:00
Michael Lotz 50c463f4f1 Header cleanup, rename macros for more consistency. 2012-12-04 23:38:03 +01:00
Michael Lotz 57e6aff3f7 Add debug helpers that communicate information via the LED.
Blink patterns and delay mechanisms allow for "easier" debugging using
just the onboard LED on the raspberry pi.
2012-11-27 20:58:31 +01:00
Michael Lotz 4818400fcf Add BCM2708 mailbox definitions and implementation.
The mailbox is used to communicate with the VideoCore on the rPi for
various tasks. First it will be used to configure the framebuffer.
2012-11-27 20:58:30 +01:00
André Hentschel a8fe6dad7e Fix header protection for the beagle board 2012-11-26 17:59:53 +01:00
Oliver Tappe 52cdfde04b Fix relying on order of static object destruction in Locale Kit.
* use only a single static object (MutableLocaleRoster) instead of
  two, which avoids any problems if the order of static object
  destruction would destroy RosterData before MutableLocaleRoster
* rename BPrivate::RosterData to BPrivate::LocaleRosterData and move
  it into a header and implementation file of its own
This should hopefully fix problems encountered with a clang-compiled
Locale Kit.
2012-11-26 01:19:27 +01:00
Rene Gollent e03ee8ba35 Add missing include. 2012-11-23 10:55:50 -05:00
Ithamar R. Adema 53a59cd99a Fix minor typo 2012-11-22 22:58:24 +01:00
Ithamar R. Adema 39b546702c ARM: fixup header comment 2012-11-22 00:00:16 +01:00
Alex Smith 11c9f9a1d6 Merge branch 'master' into x86_64
Conflicts:
	build/jam/FloppyBootImage
	build/jam/OptionalBuildFeatures
	build/jam/OptionalPackages
	headers/private/shared/cpu_type.h
	src/bin/ps.c
	src/bin/sysinfo.cpp
	src/kits/tracker/PoseView.cpp
	src/preferences/appearance/DecorSettingsView.cpp
	src/preferences/virtualmemory/Settings.cpp
	src/servers/input/AddOnManager.cpp
	src/servers/input/InputServer.cpp
	src/servers/input/InputServerMethod.cpp
	src/system/boot/Jamfile
	src/system/boot/platform/raspberrypi_arm/mmu.cpp
	src/system/boot/platform/u-boot/arch/arm/Jamfile
	src/system/kernel/arch/x86/arch_cpu.cpp
	src/system/kernel/arch/x86/arch_thread.cpp
	src/system/kernel/cache/block_cache.cpp
	src/system/kernel/vm/VMAnonymousCache.cpp
2012-11-18 14:02:07 +00:00
Ithamar R. Adema 344b3218d4 ARM/u-boot: Add support for FDTs passed in the uImage
Since we're using multi-part uImage format, we can add the FDT as
a seperate "blob" in the uImage, if the used U-Boot version is not
"FDT enabled".

This is used for example for our Verdex target. Currently I've got
a local hack in the platform/u-boot/Jamfile, looking into pulling
in the FDT files and a proper Jam setup to do that properly...
2012-11-13 12:27:11 +01:00
Ithamar R. Adema 1df5784a22 ARM: Add ARM architecture detection to generic bootloader ARM code.
This detects everything up to ARMv6 right now. Need to check more
recent ARM ARMs for ARMv7 detection.

The detected details get passed on to the kernel, which can use
the pre-detected info for selecting right pagetable format and such.

Copyright removal of Axel done after agreement with Axel @ BeGeistert
that for files that were copy/pasted from x86 arch and then fully
replaced the implementation, removal of original copyright holder is
allowed, since their actual code is gone ;)
2012-11-13 12:04:35 +01:00
John Scipione 96a5a088ba Add the authors back to AboutWindow.h, also use <> style for email addresses 2012-11-13 00:28:06 -05:00
John Scipione c73d4b3dc2 Move AboutPosition() method up. 2012-11-12 23:57:31 -05:00
John Scipione d156f97655 Get rid of the _Init() method in BAboutWindow, just the single constructor body. 2012-11-12 23:57:31 -05:00
John Scipione 97a814061e Instead of destroying the BAboutWindow object on close, Hide() it, then on the destructor of the calling window call Quit() explicitly to destroy it. 2012-11-12 23:57:30 -05:00
John Scipione 12a9a71db6 Use a quit bool in B_ABOUT_REQUESTED to indicate that the about window has quit instead of using kAboutWindowClosed message. This prevents message signature clashes. 2012-11-12 23:57:27 -05:00
John Scipione 3fdab58446 Set the about window object to NULL on close or quit.
Pass the BHandler object that opened the about window to BAboutWindow.
When the window closes, send a kAboutWindowClosed message back to the
handler. This allows the handler to set the variable to NULL.

Implement the new about dialog constructor in all apps that use it.
Remove the old constructor. This now works reliably for all cases I
tested without crashing and does the right thing on close. The setup
and teardown is a bit more complicated than I wanted though.
Unfortunately this seems to be necessary when not using a BAlert.

Fetching the app icon does not work reliably yet. This is because for
replicants the app may not be running. I may have to pass the icon in
instead of grabbing it from the signature.
2012-11-12 23:57:26 -05:00
John Scipione 5b0cd98792 WIP: Create the about dialog once, hide and show, Quit() when object is destroyed. 2012-11-12 23:57:25 -05:00
John Scipione 0046f44436 Modify about window to take an app signature.
* Grabs the app icon and version from the resource file.
* Allow you to specify the copyright holder instead of hardcoding
  "Haiku, Inc."
* Support multiple extra copyright fields.
* Modify BAlert to take a custom icon.
* Set the custom icon of the BAlert to the app icon.
* Also set the app version.

* Convert BAboutWindow to derive from BWindow
* Place a 128x128 icon and fill out a scrolling BTextView
  with options such as authors, version history, copyright,
  license, etc. Still needs some work but is coming along.

* Add the word Version to the version line, i8n'ed of course,
  and tweak the info box and default sizes.
2012-11-12 23:57:24 -05:00