Commit Graph

62407 Commits

Author SHA1 Message Date
Adrien Destugues
d1fee57dee mmc_disk: add SDHC support.
The main differences:
- The initialization sequence requires an additional command (this was
  already done)
- The layout of the CSD register and the way to compute the device
  geometry from it changes
- The read and write commands parameter is a sector number instead of a
  byte position

Change-Id: Ie729e333c9748f36b37acd70c970adfd425cf0b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3512
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
e21a1abec4 mmc: properly set DMA restrictions
- The restrictions are now set by the sdhci bus and retrieved from there
  by the DMAResources.
- Configure SDMA with the maximal available boundary check of 512K and
  publish the corresponding DMA restrictions.
- dma_resource cannot be initialized implicitly as a member of
  mmc_disk_driver_info because mmc_disk_driver_info is allocated with
  malloc/free, not new/delete. So we now explicitly allocate and delete
  it.

This allows reads and writes of more than a single block at a time.

Change-Id: Ibb97c91543312c7970c28a7a8c68a12708263e32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3505
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
9a37366b51 mmc_disk: add write support
Change-Id: I77cf1612569c43e79917ac5a1493b7ab4a04cb47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3504
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
7a160a8629 mmc_disk: read using "simple DMA"
The SDHCI spec also offers an "advanced DMA" mode where we can use
scatter-gather lists. It would allow to remove several of the DMA
restrictions, but hardware support for it is optional, so we need this
version anyway.

The geometry is retrieved on demand in the first read or write or in a
call to the get geometry or get device size ioctl. It is not possible to
retrieve it from the device initialization because that is called as
part of the mmc_bus scanning, which needs a specific sequence of
commands and keeps the bus locked to prevent drivers to insert their own
commands in the middle of that sequence.

TODO:
- Move the DMA restrictions definition to sdhci_pci and forward it up to
  mmc_disk (which is the one creating the IOScheduler)
- Decide if we want to keep non-DMA support (probably should, but it
  makes things more complex, because it uses virtual addresses)

Change-Id: Ib1dd14eacf62052d747bfb3ef7820bc5a34d3030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3471
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-05 02:06:44 +00:00
Adrien Destugues
cc2642c124 sdhci/mmc: add to the image.
Change-Id: Ic43965efea2c62b6e731c7552e4f27d6d20fc26b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/448
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2021-01-05 02:06:44 +00:00
Alexander von Gluck IV
6b49a15b64 media_kit: Dynamic allocation of ChunkCache based on media
* The "default" of 3MiB wasn't enough for modern larger media
  formats, resulting in inability to play 4k video no matter
  how much horse power you threw at Haiku. (4k is ~8MiB)
* This dynamically calculates the ChunkCache based on the
  video framesize * 2.
* 4k video now plays smoothly on my Ryzen 1800x.

Change-Id: I65bf6bd6fa60ac3196ea70eeeb5e655d43c10bcd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3598
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-03 20:51:37 +00:00
Autocomitter
162f0ea529 Update translations from Pootle 2021-01-02 08:51:41 +00:00
PulkoMandy
76fed28ab1 sparc: implement elf relocation
Needed to load the kernel properly.

Change-Id: Iab520398271be2ee3a740af4104960367c3b4ea9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3585
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:10:43 +00:00
PulkoMandy
b992c828cf sparc: add kernel debug output
Mostly the same as PowerPC, using OpenFirmware.

Change-Id: I197cc181e92da92c272ee9cfa20c8ad2d2c63d41
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3579
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:10:43 +00:00
PulkoMandy
7c2dc33027 sparc: fill in kernel entry code
- Fix elf32 vs elf64 (copied from EFI)
- Write the kernel start code

Change-Id: I6133185681307ecabc617b47b36551e52f9ac2c9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3578
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:10:43 +00:00
PulkoMandy
a27d19ee57 openfirmware: move text cursor to top of screen before showing splashscreen
If we need to display some text during boot, it's nicer to have it on
top of the splashscreen, rather than scroll the display down.

Change-Id: I897073d31120ec3eebd2edc4632960db7eb7977d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3596
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:04:13 +00:00
PulkoMandy
0da81fed54 sparc: fix interrupt enable/disable code
The manually written code was all wrong (missing branch delay slots,
wrong type of return instruction used, probably more bugs). Use the same
approach as x86 to have inline functions instead, which is much better
for performance and simpler to write.

Change-Id: Iac0fc814c15311658f983da58ac7f9d3edd75b81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3595
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:04:13 +00:00
PulkoMandy
6f743e6853 sparc: remove unneeded atomic implementation
The definition in SupportDefs.h using gcc builtins is sufficient. No
need for a custom one. The same approach is used on x86 with gcc8
already, but other platforms had not been adjusted to use it.

Change-Id: I3973ff723a31f90cc8d19ac098eb1e85d471d610
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3594
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 22:04:13 +00:00
Gerasim Troeglazov
55cf87a88c wacom: Add Product ID for One by Wacom (CTL-671) tablet.
Change-Id: Iddd89877d857e87ca226dc834292bbabd3a0ca36
2021-01-01 23:50:20 +10:00
PulkoMandy
d5d6ada3fd sparc: Fix linker script for PIE
Our bootloader really doesn't want the executable section to also be
writable (even if it needs to, for relocation purposes).

Force it to be read-only in program headers by explicitly setting the
flags.

Change-Id: I5b780f6fd9df5f073f0cbc6cc96bc21479004d2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3584
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
6fd0953545 sparc: implement thread local storage support
The sparc ABI reserves the g7 register for this.

Change-Id: I93b81ecef72cde859972ef7b7f6b9991d35f9f29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3583
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
c99c0d9d5a sparc: kernel needs to be position independant
Change-Id: Id3da074c1c02dfc5bdedb8e1d0d5c2130c978325
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3582
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
c40ab52437 sparc: move stack ouf of the way
This was copied from PPC and is not done on any other architecture.

Having the stack use the kernel address results in the kernel being
loaded elsewhere. Not really a problem (the kernel is relocatable), but
it's annoying when debugging as addresses need to be converted between
the elf file and the actual loading address.

Change-Id: Iab25af1fb8998b7ef5c583459c134aea80be8d72
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3581
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
cc6b376cfb KernelLd: the kernel must be rebuilt when its linker script is modified.
Change-Id: I4f8bf6757b716f910116509419452cfc4c7f6216
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3580
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-01 00:45:13 +00:00
PulkoMandy
964ce00391 openfirmware: we need a larger bootloader heap size
Currently about 366K are used. Round up to next power of two.

Change-Id: Id6713b4f4eebfbced310bbd75a16a5737228ae72
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3577
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
75c2a94a87 sparc mmu: fix free physical range search
The code was ignoring most of the memory and eventually didn't find
enough of it to load all kernel modules.

Change-Id: I8abcb6cd20eb2a37147d720eb63af1c2820628f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3576
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
19024bc416 openfirmware: synchronize number of memory range with bios and efi
It was bumped for bios and efi from previously very low values, but
other architectures did not follow.

Change-Id: I6ce92e2cdb0261d4d0637753e77d555d407073fc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3575
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
baca34bee5 bootloader heap: more detailed errors on out-of-memory
It's hard enough to debug bootloader code already, let's gather as much
info as we can from error messages.

Change-Id: I47dff402286625d1213caa36ae6ee8ecf707dfad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3574
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
bba45f645b openfirmware: fixup video driver for 64bit
We now have a bootsplash on sparc!

Change-Id: I583a3015a86618292088fe4379f548467d30ec4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3572
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
PulkoMandy
185e6809fc sparc: Build fixes
- Wrong printf format in bootloader elf panic call
- Missing functions for sparc

Change-Id: I4715a8d6d3d864d379b8386dc3958e0a2c1962e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3571
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-31 02:58:10 +00:00
Jérôme Duval
03c037b99a bootloader: defines _BOOT_PLATFORM_BIOS on x86/bios_ia32 2020-12-30 22:23:51 +01:00
PulkoMandy
55f429bd0e sparc: split the kernel into separate data and exec regions
This is what our bootloader expects. For some reason, ld does this by
default on x86, but not on other platforms. So, define the headers
ourselves.

Change-Id: I4b37938e7e6d48b19c8af68cf4a77193269335d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3569
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
89806d4075 openfirmware: Make realtime clock init non-fatal
The realtime clock is used only to seed the random number generator for
picking a random TCP port. This is not very important, so there's no
reason to completely fail when it doesn't work.

Change-Id: I50123433153c16595118fdf923f4b707e2c98fdd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3568
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
9a8463437d bootloader elf: fix misaligned access
The elf region structure is packed. So it's not possible to use a
pointer to one of its fields on sparc. Use a temporary variable that's
properly aligned.

Change-Id: I9dd9b9f2b1d14821e34bc2f5b3da661086ef3fef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3567
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
2ef7fd7186 bootloader elf: fix elf64 loading for non-x86 platforms
Some code was enabled only for EFI, but is in fact correct for all
platforms except BIOS. Switch the defines around to have the correct
code enabled by default.

Change-Id: I58b1d17a78dcf273ceee88318338b4770b500bb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3566
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
85b4ce6191 bootloader elf: fix tracing for 64bit
Change-Id: I59f22c5768ed245cfd937be3f60127672d6ffc61
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3565
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:15:52 +00:00
PulkoMandy
3463eeac01 openfirmware: add a menu entry to go back to the firmware prompt
It's annoying to need to reboot the machine everytime I test a change to
the bootloader.

Change-Id: I1bc8530f397b2a6d66ec26f08527dab9b2a2699b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3564
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 18:12:07 +00:00
Pascal Abresch
f924bac3c7 StyledEdit: Fix New menu item after hrev54812
Change-Id: I583bc43dc64d46e92e20e46da9a894c489617d43
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3563
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 17:36:10 +00:00
Pascal Abresch
39b50e1008 StyledEdit: fix statusview font size
Change-Id: I0d1fd0c0d3628c30c17748e11accc9907d028953
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3562
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-30 17:36:10 +00:00
Pascal Abresch
0d6b19e963 DeskCalc: Remove __HAIKU__ ifdef
No functional change intended

Change-Id: I934bef5c8b09a267c423edf7698bb57170e43945
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3559
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-12-30 14:47:39 +00:00
Alexander von Gluck IV
013554844f file_system/fat: Fix minor typo in last commit. Unintentional uchar to char
Change-Id: I51aab4690c6964c1daf1a2c8882756c393e354dd
2020-12-30 08:26:42 -06:00
Alexander von Gluck IV
9f3ba01bd3 file_system/fat: Rework driver for fs_shell support
* Introduce fat_shell for build system fat manipulation
* Will theoretically let us do away with mtools when we
  have another internal tool for partition manipulation

Change-Id: I661be556e79009842f157a9402c8f85da85d6336
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3556
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 14:10:19 +00:00
jpdw
aa013a511f WebPositive: Dropdown menu for choosing search engine
- Move the list of search engines used for search shortcuts to
  SettingsKeys.cpp/h and remove need for dynamic allocation.
- Use it in the settings window to help filling the default search
  engine field.

Fixes #15218.

Change-Id: I3783f6a346ad0fef2cff97eb930cb98cee39f660
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3439
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 13:55:10 +00:00
Axel Dörfler
786f045666 BootManager: add support for page down/up/home/end keys
* Page down is the same as the end key, and just selects the last entry
  in the boot menu.
* Likewise, page up is the same as the home key.

Change-Id: Ibaf8559b0f68462834395aaec8fb22554d7a90f6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3555
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-30 13:36:01 +00:00
Jérôme Duval
a7375336a6 virtio_net: enable initial multicast
ATM we don't filter multicast addresses.

Change-Id: I762b65504d04ab79e3bc3fe0b99d06f30f0768c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3454
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 13:35:27 +00:00
Máximo Castañeda
2e68fbd207 Fix wrap for AUDIO_INT
Floats don't have enough precision for all 32 bit integers. In
particular, near INT32_MAX their value is INT32_MAX + 1, which, when
converted back to int becomes INT32_MIN.

Change-Id: Ief3c1177b4f69baac13df5bac977882fea95ae01
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3511
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 13:35:14 +00:00
Jaidyn Ann
4c8cf0257e MediaPlayer: Fix randomizer command typos
Change-Id: I6e136477dd6b74c2f877756451b94779d02f8ff8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-29 21:44:54 +00:00
Jaidyn Ann
1cfb79d74a MediaPlayer: Fix playlist manipulation on x86_64
Fixes a problem on x86_64 with removing, shuffling, and moving
multiple playlist items.

Instead of casting directly between an array of addr_t and int32
values, an int32 array is filled manually. Commands are passed
BLists instead of int32 arrays.

Fixes #15737 #16698

Change-Id: I5f67cd511ba10b16bd52d87cda380dd15ce7ee67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3553
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-29 19:20:36 +00:00
Adrien Destugues
b966e83785 Add some documentation for libroot
Mainly for features.h and feature defines, which seems to be an ongoing
source of confusion and not well understood.
2020-12-29 14:04:20 +01:00
Adrien Destugues
683d891a6b Fix typo in BNotification documentation 2020-12-29 14:04:15 +01:00
Adrien Destugues
db7dcab7b1 asprintf should be available if _GNU_SOURCE is defined
As documented in the Linux manpage:
https://man7.org/linux/man-pages/man3/asprintf.3.html
Change-Id: I855b3310ae9111ddf48c13c26b9eb496c200accb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3554
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2020-12-28 23:09:21 +00:00
Adrien Destugues
99f2b96894 elf.h: add some missing defines
Needed for ghc.
2020-12-28 22:20:43 +01:00
Jérôme Duval
1f8a8d2b48 boot/bios_ia32: basic support la57 aka 5-level paging for x86_64 kernels
la57 kernel support is required. we simply add a 5th level and enable the cr4
feature. the safemode option "256tb_memory_limit" is named after the 4gb one,
but the current support is limited to 512GB as before (this can be later extended).

Change-Id: I922774473c4a6112a0e4ff74162285ad58aa53af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3552
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-28 18:21:11 +00:00
Jérôme Duval
58353b3809 kernel/x86_64: LA57 aka 5-level paging
this enables the kernel to correctly take over when the bootloader prepares
the paging in 4-level or 5-level.

Change-Id: I0444486d8e17aade574e2afe255a3c2cfc49f21f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3551
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-12-28 18:21:11 +00:00
Andrew Lindesay
cb8472235b HaikuDepot: Screenshot List
Remove the use of custom list class related to
screenshots on a package.

Relates To #15534

Change-Id: I8289c25ef0ab5a6715dd9c6c83b6602a25d2f544
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3549
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-27 19:32:57 +00:00