Commit Graph

62047 Commits

Author SHA1 Message Date
François Revol
86776c1ebe m68k: detect NeXT framebuffer
Doesn't work yet though:
- we don't implement heap yet,
- non-color machines have 2bpp, so we'll have to hack this in some way.

Change-Id: Idf8f69c2256837db3915949d93265decbb43a524
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3097
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-08-19 13:37:21 +00:00
François Revol
ab17378328 m68k: Add more NeXT boot rom stuff
Those were found in the official headers in the NeXTstep ISO, how come I
didn't even look there in the first place?

We do get enough info to use the framebuffer, but sadly the SCSI IO
seems invalid. Both the NetBSD and even NeXTstep bootblock have their
own embedded drivers, maybe they didn't trust their own rom?

Change-Id: I0a47c433da89b15091644cd5c69ffff24d0cdd1f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3096
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-08-19 13:36:51 +00:00
François Revol
5c9d51ef00 m68k: make sure boot & kernel code can run on 020-060
Change-Id: I5830085fcd6120600ff3be85a2fdd2602e1935fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2221
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-08-19 13:35:41 +00:00
François Revol
ec5a799719 m68k: add next_m68k boot platform
Since the boot ROM API structure is declared with a custom alignment, we
simulate it with padding bytes around, and use aligntest.prg to verify
using ARAnyM + TOS/MiNT as we know how to link simple PRG files.

It now prints something to the screen then panics when initializing the
heap.

For now one must insert the loader manually into an existing floppy
image:
dd if=generated-m68k/objects/haiku/m68k/release/system/boot/next_m68k/haiku_loader.next_m68k bs=$((0x8000)) seek=1 of=next_floppy.img conv=notrunc

Change-Id: I06d74e9d85a352aab68dedce545bbe5fe9e990d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2220
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-08-19 13:35:19 +00:00
François Revol
53b97f0d18 m68k: add fenv from musl-1.1.24
FreeBSD doesn't have m68k anyway, so use fenv from musl with as less
changes as possible.

Not sure the 'hidden' define should go there.

Change-Id: I343f72d61dcacf7dfc180d112529f5a6521d7e3b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2213
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-08-19 13:34:55 +00:00
John Scipione
22758f1690 Revert "IK: align BTextView text rect/fix alignment"
This reverts commit a9b301871d.

hrev54496

Change-Id: Ife3c834ad98d330f04976d9adf3b1553e7aca034
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3153
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-08-19 03:38:41 +00:00
John Scipione
90f9b5590f App Server: Save decorator path on load, fixes #16412
Change-Id: Ia536764d4abb79772e4d3f16e2364d87792d60fd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3150
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-08-19 03:22:09 +00:00
François Revol
a088631dc6 build/repositories: Fix m68k HaikuPorts and Cross
Change-Id: I0ebdd096558a6f060d6bcd56807903f1496e8ed6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2211
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-08-19 00:08:10 +00:00
Michael Lotz
4df4ae2e80 kernel/x86: Enable machine check exceptions if supported.
This enables generation of exceptions that are due to uncorrected
hardware errors. The exception handlers were already in place and will
now actually trigger kernel panics.

Note that this is the simplest form of MCE "handling" and does not add
anything of the broader machine check architecture (MCA) that also allow
reporting of corrected errors. As MCEs are generally hard to decode due
to their hardware specifity, this merely makes such problems more
obvious.

Might help to discern hardware issues in cases that would otherwise just
triple fault and cause a reboot.

Change-Id: I9e3a2640458f7c562066478d0ca90e3a46c3a325
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3155
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-08-18 06:54:53 +00:00
John Scipione
f9b3a3b1f3 Deskbar: Restore old mini-mode
... with the replicant tray below the menu bar.

Deskbar now has four modes:
1. vertical mini-mode (old mini-mode)
2. horizontal mini-mode (new mini-mode, was vertical)
3. vertical expando-mode (default)
4. horizonal expando-mode

Horizontal mini-mode gets the corner, then it switches to vertical
mini-mode above or below that, then to vertical expando-mode after
that. Horizontal expando mode is in center-screen top and bottom.

Clock vertical centering simplification.

Change-Id: I216008c20feb28f793693046792bbcfdf1e703e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3146
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-08-17 21:11:31 +00:00
Michael Lotz
2e4840b45c es1370: Fix print formats by using format macros. 2020-08-17 21:05:37 +02:00
Michael Lotz
4f11ee9f78 es1370: Change physical addresses to phys_addr_t.
Solves a TODO and some pointer to integer cast warnings.
2020-08-17 21:05:37 +02:00
Michael Lotz
5217ff8fa7 es1370: Fix pointer arithmetic warning by adding a cast. 2020-08-17 21:05:37 +02:00
Michael Lotz
44c014b0af es1370: Add driver to build.
Works under QEMU with some glitches.
2020-08-17 21:05:37 +02:00
Michael Lotz
758661fee6 es1370: Always enable PCI bus mastering.
Makes the device work under QEMU with "-soundhw es1370".
2020-08-17 21:05:37 +02:00
Michael Lotz
738ccb5a78 es1370: Apply SMAP fixes based on hrev51775. 2020-08-17 21:05:37 +02:00
rofl0r
7de1ebe0d6 netdb.h: fix prototype of gethostbyaddr()
first parameter should be const void*, in line with freebsd and linux etc.

https://xref.landonf.org/source/xref/freebsd-current/include/netdb.h#232

Change-Id: I5e953e8e7e49a6f09cd1143de6ca57eb98f77d73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3147
Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
2020-08-17 00:08:02 +00:00
Michael Lotz
c367ace2ae auich: Fix pointer arithmetic warning by adding a cast. 2020-08-17 00:59:16 +02:00
Michael Lotz
c839d521c4 auich: Always enable PCI bus mastering.
Without it, the device can't operate at all. Whether or not this is
enabled already is firmware dependent. It was off under QEMU when used
with "-soundhw ac97" and this makes the driver work there.

Fixes #10551 where the syslog shows that this can also happen on real
hardware that is otherwise fully configured.
2020-08-17 00:37:49 +02:00
Autocomitter
105519f79a Update translations from Pootle 2020-08-15 08:45:06 +00:00
John Scipione
702f22b7d2 MacDecorator: Whitespace style changes only
Change-Id: Iae2533e553df66945de8394b4678d487ff9de60e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3141
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: CodeforEvolution <secundaja@gmail.com>
2020-08-13 09:04:05 +00:00
Adrien Destugues
6d9c0146a5 BGradient: fix assignment operator, add copy constructor
The BGradient class is a bit strange as it can store any gradient on its
own, butonly the subclasses allow to set some of the fields.

In the asignment operator, the non-base data (which is in an union) was
not copied over.

More importantly, the missing copy constructor led to the default
implementation being used, and BList (used for the color stops) was
being copied using its default copy constructor, resulting in the two
BGradient (original and copy) poinitng to the same stops data. Heap
corruption resulted whenever one of them was deleted.

Having a working copy ocnstructor fixes this. The alternative is making
the copy constructor private or protected to make sure gradients are not
copied, since normally you'd copy only the subclasses, preserving the
C++ type. However there is nothing enforcing that, and manipulating a
BGradient copied from a subclass works just fine.

Change-Id: I28e733eb8a2970b76ae623eabb75ef8435f508af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3144
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-11 20:46:34 +00:00
Niels Sascha Reedijk
3f7f989680 Installer: Remove level parameter from CopyEngine
The level parameter in the CopyEngine::CollectCopyInfo() and
CopyEngine::Copy() methods was introduced in hrev30395 to allow the CopyEngine
to decide which directories should be copied. Since then, this
class has been rewritten and it is no longer necessary for that purpose.

This change refactors the CopyEngine and removes the
level parameter from the class interface. Furthermore, it was broken to begin
with; it was passed as reference to the internal recursive _Copy() and
_CollectCopyInfo() methods, meaning they acted like a global counter. The
global counter was increased at the beginning and decreased at the end of those
methods. Execution could terminate early though, leaving the level counter out
of sync with the recursion level.

There is one use of the level parameter, namely in the
WorkerThread::EntryFilter::ShouldClobberFolder() method, but the use of the
parameter was wrong (it would have been at level 3 at the point of the check,
not level 2) and the logic is functional without the level check.
Change-Id: Id92ef89b015e9b1185bde061273f61e492664bce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3139
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-08-11 15:25:30 +00:00
Adrien Destugues
26d0a387e8 DeskBar raise-to-front: reintroduce fLastClickTime
This was removed in hrev33708 when enabling the "double click to raise"
feature. It results in all clicks after the first one just raising the
team again.

Fixes #8471
2020-08-08 15:18:54 +02:00
Adrien Destugues
836100d505 Pulse: adjust chip size to fit CPU name
Fixes #6904
2020-08-08 10:32:39 +02:00
Alexander von Gluck IV
73bec01575 system/ldscripts: add missing init_array/fini_array for arm kernel
Change-Id: I2c7a7bd25401900ee22f6bb953d055e28670776e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3108
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2020-08-07 12:01:15 +00:00
Alexander von Gluck IV
6c32d3c9e7 boot/efi: Begin working on loading kernel_arm
Change-Id: I5c71f061fab2215f3978a39d87c2d2a686a2c7bc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3107
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-08-07 12:01:15 +00:00
Adrien Destugues
d45473bd96 Pulse: remove hardcoded bitmap
This will allow resizing the chip as needed.

Part of #6904
2020-08-06 22:07:07 +02:00
John Scipione
a9b301871d IK: align BTextView text rect/fix alignment
Preserve passed in text rect in fTextRext (unless in layout)
and create an internal version fAlignedTextRect which is used
in place of fTextRect. fAlignedTextRext is aligned to fit the
text rect bounds and grows to fit. fAlignedTextRect always grows
vertically but only grows horizontally if wrap is off.

Left-aligned text view's grow right, right-aligned ones grow left,
and center center aligned ones grow out.

Set fTextRect to bounds in _DoLayout().

Reduce left and right padding inside text views from full label
spacing to half label spacing. Unify padding between BTextControl
and BTextView.

Fixing padding also fixes right and center-aligned BTextViews.

Undo extra scrolling for non-left text views from hrev24130 fixing
a scrolling left and right with mouse bug when it shouldn't.

Replace max_c and min_c with std::max and std::min respectively.

Remove scrolling from one instance of BTextView::SetText as it
produced undesired results while editing a scrolled text view.

Set text rect in BTextControl::DoLayout() and ScreenSaver
PreviewView::AddPreview().

Don't add padding if BTextView::SetInsets() is called. Set insets
to 0 in Tracker "Edit name" setting which prevents default padding
from being added. This is so that when you rename a file in Tracker
the TextView appears on top of the file name text with no padding.

80 char limit fixes.

Fixes #1651 #12608 #13796 #15189 #15688

Change-Id: I8c6106effc612f49aff374f29742471628b5df86
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3054
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-08-06 11:51:15 +00:00
Adrien Destugues
a8ea8cd1d4 ffmpeg: fix memory leak in error case 2020-08-05 23:07:48 +02:00
Adrien Destugues
a11a58d4d0 ffmpeg: avoid assert in ffmpeg
The input colorspace must be set.
2020-08-05 23:06:31 +02:00
Adrien Destugues
4fb9b30056 PowerStatus: exit early if no battery is detected.
Fixes #7472
2020-08-05 19:47:38 +02:00
Adrien Destugues
ca6302dded BTextView: remove useless and heavy computation
There is no point in computing line breaks for a 10px wide text view and
it takes a long time because it needs a lot of linebreaks. The view
eventually gets laid out properly.

This may cause regressions, the TODO here is very old and I don't know
to which "other parts of the code" it refers. Possibly they were
rewritten, possibly not. In any case, there is no point in keeping this
nonsense initial text rect computation, it's better to fix the actual
problems.

Fixes #5582 (which was not locale-related, after all)
2020-08-05 18:39:28 +02:00
Adrien Destugues
0d1f89e1a3 TranslatorRoster: avoid a deadlock when launching BeLive
If be_app is not running yet, trying to lock it may easily end up in a
deadlock.

Fixes #2105

However, as a result of this, when this situation happens, the
translator roster will not be node monitoring added/removed translators.
This was already the case if BTranslatorRoster::Default was called
before BApplication constructor, now it's also the case if called inside
the BApplication constructor or from another thread before it finished
running.

Maybe BTranslatorRoster should try to register itself later on if it
detects this. But it's acceptable to have the app not monitor
translators, because adding and removing translators isn't a very common
occurence and restarting the app to get it to notice them is probably
ok.
2020-08-05 15:39:19 +02:00
Adrien Destugues
9027ca04e2 Tracker: fix infowindow resizing
Fixes #16053
2020-08-05 14:40:06 +02:00
Adrien Destugues
2c09e0dc7f Installer: separate writing bootsector from other install finishing code
Remove the InstallerInitScript (it does nothing) and the
InstallerFinishScript (it does too many things). Instead implement the
finishing directly in Installer. Separate writing the bootsector, so
that the "write bootsector" menu writes only the bootsector.

Fixes #16303
2020-08-05 12:52:04 +02:00
Adrien Destugues
d077ef8a1a better error message when xsave context is too small 2020-08-05 12:31:10 +02:00
Adrien Destugues
daf10ef340 install-wifi-firlwares: stop using haiku-files.org
- Move the firmwares to github
- Move broadcom fwcutter to a package

Fixes #11841
2020-08-04 10:52:19 +02:00
Adrien Destugues
b4b9e2089f libicon: reorder gradient stops when loading from BMessage
Some files have gradients stops stored in an incorrect order.

Fixes #14210
2020-08-02 17:42:44 +02:00
Adrien Destugues
e4c945bd5a Icon-O-Matic: fix filename length limitation
The code was using B_OS_NAME_LENGTH instead of B_FILE_NAME_LENGTH.
Use of BString allows to put the different sizes in a loop.
2020-08-02 17:27:49 +02:00
Adrien Destugues
1bad1ff34a Prepare for ICU update
- libicule and libiculx do not exist anymore in newer ICU versions
  (harfbuzz replaces them), but we didn't actually use them, so remove
  them from the build feature and from the package dependencies
- Add namespace usage marcos since the newer ICU packages put ICU things
  in a namespace, making it easier to have multiple versions of ICU used
  side by side.

No functional change intended, but this makes it possible to build the
code with either ICU 57 (for gcc2) or 66 (for other architectures).
2020-08-02 11:58:14 +02:00
Michael Lotz
b3aed2adb5 VMUserAddressSpace: Don't print unset reserved area name in KDL.
Reserved areas don't have the name field initialized, so explicitly
print "reserved" instead.

Change-Id: I26bcfcb8facb8b5df11a58074506e96a41943e31
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2847
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
7d432fc911 VMKernelAddressSpace: Let Dump() print all ranges.
This makes the output of the aspace KDL command more useful as it shows
reserved and free ranges in addition to areas.

Change-Id: Id6353820b7c040fce6bfc3297c1b34adb1c9bb99
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2846
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
2555f33549 Cleanup: Various comment and whitespace fixes.
Change-Id: I37c3e3346813efc595df651421b7e8ff4fbf3339
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2845
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
b3bd66961a libroot/kernel: Implement MADV_FREE madvise() extension.
It allows an application to signal that it no longer needs the data in
the given address range and the underlying pages can be discarded and
reused elsewhere. This is finer grained than working with full areas
or mappings at a time and enables unmapping sections of partially used
mappings without giving up its address space.

Compared with punching holes into a mapping by "mapping over" with
PROT_NONE and MAP_NORESERVE, this has the obvious advantage of not
producing a lot of unused extra areas and saves the corresponding
resources. It is also a lot "lighter" of an operation than cutting
existing areas.

This introduces madvise() alongside the existing posix_madvise() to
allow for OS specific extensions. The constants for both functions are
aliased, the POSIX_MADV_* being a subset of the MADV_* ones without the
non-POSIX extensions. Internally posix_madvise() simply calls madvise().

MADV_FREE is commonly supported in other OSes with various subtle
semantic differences as to when pages are actually freed/cleared and how
or whether the pages are counted against the memory use of a process.
In the variant implemented here, pages are always immediately discarded
and memory counting is not altered. This behaviour should be considered
an implementation detail and may be altered later. The actual unmap and
discard could for example be delayed until pages are needed elsewhere to
reduce overhead in case of repeated discarding and remapping.

Note that MADV_FREE doesn't really align with the rest of the madvise()
API as it works like a command (i.e. discard these pages) and does not
add an attribute to the pages in the given range (i.e. mark these pages
for quick access from now on). As such, an MADV_FREE does not need to be
undone by setting a different advice later on, unlike how the other
flags work. This discrepancy may be the reason why it is not part of
POSIX.

Change-Id: Icc093379125a43e465dc4409d8f5ae0f64e107e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2844
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
8e74e30784 kernel/vm: Add discard_address_range that discards pages.
Pages in the given range are unmapped and freed without getting written
back anywhere. It can be used whenever a caller does not care about the
data in the given range anymore and wants to reduce page pressure.

Change-Id: I8bcce68fab278efef710d3714677e1d463504a56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2843
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Adrien Destugues
4bfc0072e3 limits.h: ncrease ARG_MAX
The limit was set when creating limits.h back in hrev88. It seems to be
used only in glob(). The limit is quite low by today standards and
prevents building icu 67.

I guess the liit was put at 32K because that's what BeOS did, but I see
no reason to keep it that way.

Change-Id: I74f95d9b56891dd90c79b7ced35ca8d1ec81d6ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3117
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 17:37:01 +00:00
Alexander von Gluck IV
c17fa27430 efi: Switch to direct EFI loader creation
* efi-app-x86_64 is a undocumented legacy compatibility
  target from the early days of EFI.
* This opens the door to native arm,arm64 loaders without
  the gnu-efi 'fake pe' stubs in the future.
* This change also clairifies what's happening within the
  undocumented efi-app-x86_64
* Future as in binutils fixing these:
  https://sourceware.org/bugzilla/show_bug.cgi?id=26206
  https://sourceware.org/bugzilla/show_bug.cgi?id=26218

Change-Id: I60b4a4f5ceb36059033debbe6bf5b01928d6b223
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3016
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2020-08-01 16:16:23 +00:00
Autocomitter
7e8f3368fa Update translations from Pootle 2020-08-01 08:07:47 +00:00
Michael Lotz
de6a5cb90c Cortex: Fix buffer overflows in label truncation.
The label to be truncated was copied into a fixed width buffer without
taking the null byte into account which would make
BFont::GetTruncatedStrings() read out of bounds when the name got long
enough. The output strings were also not allocated with the required
extra space for the ellipsis which would possibly have caused the
output to overflow.

Since the goal is to truncate a single string, remove the entire
temporary extra allocations and simplify to use BFont::TruncateString()
directly, which avoids both problems by being BString based.

Change-Id: Ib57430faf6f706c705497191000ee9686441857e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3116
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 02:04:43 +00:00