summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-23linux: Add noide and noahci kernel optionsSamuel Thibault
They were meant to be temporary, but that got longer, and people seem to expect them to be there now.
2024-01-23Resurrect x86-linux build.Janneke Nieuwenhuizen
This avoids using system headers, which may result in kern/strings.c: In function 'strchr': kern/strings.c:188:32: error: 'NULL' undeclared (first use in this function) In file included from util/atoi.c:77: ./util/atoi.h:65:29: error: unknown type name 'u_char' device/net_io.c: In function 'bpf_do_filter': device/net_io.c:1636:34: error: 'u_int' undeclared (first use in this function); did you mean 'int'? In file included from device/subrs.c:36: ./device/if_ether.h:43:9: error: unknown type name 'u_char' 43 | u_char ether_dhost[6]; ./linux/dev/include/linux/fs.h:304:5: error: unknown type name 'loff_t' 304 | loff_t f_pos; This is a follow-up to commit d5e5dd3401ea0d0475aa830c2171be5b8a72f4fa Update configure.ac so that we don't need glibc when running ./configure. Message-ID: <20240122075549.26207-1-janneke@gnu.org>
2024-01-20console: Fix baud rate on com ports, use 115200 default baud, 8 data bitsDamien Zammit
TESTED: By booting gnumach off an HP T620 with console=com0 and receiving 115200 8N1 console on another machine connected via the serial port in minicom. Without this patch, part of the console is garbled by mismatching com params (9600 7N1). Message-ID: <20240119031214.691086-1-damien@zamaudio.com>
2024-01-13tests: clean test-installed mach headersSamuel Thibault
We are for now lacking proper dependencies between the source headers and the test-installed headers, but we can at least clean them out.
2024-01-13add basic thread testsLuca Dariz
Message-ID: <20240111210907.419689-11-luca@orpolo.org>
2024-01-13add basic task testsLuca Dariz
Message-ID: <20240111210907.419689-10-luca@orpolo.org>
2024-01-13add raw mach_msg testsLuca Dariz
Message-ID: <20240111210907.419689-9-luca@orpolo.org>
2024-01-13add syscall testsLuca Dariz
Message-ID: <20240111210907.419689-8-luca@orpolo.org>
2024-01-13add thread creation helper to testsLuca Dariz
Message-ID: <20240111210907.419689-7-luca@orpolo.org>
2024-01-13add basic vm testsLuca Dariz
Message-ID: <20240111210907.419689-6-luca@orpolo.org>
2024-01-13adjust range when changing memory pageabilityLuca Dariz
* vm/vm_map.c: use actual limits instead of min/max boundaries to change pageability of the currently mapped memory. This caused the initial vm_wire_all(host, task VM_WIRE_ALL) in glibc startup to fail with KERN_NO_SPACE. Message-ID: <20240111210907.419689-5-luca@orpolo.org>
2024-01-13add mach_port testsLuca Dariz
Message-ID: <20240111210907.419689-4-luca@orpolo.org>
2024-01-13add gsync testsLuca Dariz
Message-ID: <20240111210907.419689-3-luca@orpolo.org>
2024-01-13add mach_host testsLuca Dariz
Message-ID: <20240111210907.419689-2-luca@orpolo.org>
2024-01-13add basic user-space tests with qemuLuca Dariz
* configure.ac: move test fragment to have USER32 * tests/Makefrag.am: add user tests * tests/README: add basic info on how to run and debug user tests * tests/configfrag.ac: allow the test compiler/flags to be autoconfigured or customized * tests/grub.cfg.single.template: add minimal grub config to boot a module * tests/include/device/cons.h: add a simplified version of device/cons.h usable for tests * tests/include/kern/printf.h: symlink to kern/printf.h * tests/include/mach/mig_support.h: add basic version for user-space tests * tests/include/syscalls.h: add prototypes for syscalls used in tests. * tests/include/testlib.h: add definitions for common test functionalities * tests/include/util/atoi.h: symlink to util/atoi.h * tests/run-qemu.sh.template: add a simple qemu test runner * tests/start.S: add arch-specific entry point * tests/syscalls.S: generate syscalls entry points * tests/test-hello.c: add basic smoke test * tests/testlib.c: add the minimal functionality to run a user-space executable and reboot the system, and some test helpers. * tests/user-qemu.mk: add rules to build simple user-space test modules, including generating mig stubs. The tests reuse some kernel code (like printf(), mach_atoi(), mem*(), str*() functions) so we can use the freestanding environment and not depend on glibc. Message-ID: <20240111210907.419689-1-luca@orpolo.org>
2023-12-29expose MACH_MSG_USER_ALIGNMENT for manually-built messagesLuca Dariz
Message-ID: <20231228194301.745811-11-luca@orpolo.org>
2023-12-29USER32: change default to disabled and make it a general optionLuca Dariz
* configfrag.ac: add the global option USER32; although it makes sense for 64-bit versions only, it can be used by future 64-bit architectiures and not only x86_64. Also, change the default setting to be disabled; now that we have a working full 64-bit system, it makes sense to consider it the common choice. * x86_64/configfrag.ac: define the correct 32-bit cpu if USER32 is enabled. Message-ID: <20231228194301.745811-2-luca@orpolo.org>
2023-12-17Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are byte ↵v1.8+git20231217Flavio Cruz
aligned msgt_unused appears right after msgt_size since msgt_size can be reduced to only 8 bits in the future, so we leave the door opened to make msgt_unused 13 bits long.
2023-12-17x86_64: Support 8 byte inlined port rights to avoid message resizing.Flavio Cruz
If a port is inlined in a message, the user has to use mach_port_name_inlined_t to define each port. Out of line memory continues to use mach_port_name_t since that memory has to be copied to the kernel anyway. Both copyinmsg and copyoutmsg can be reduced to nothing (if we ignore USER32) as a follow up but kept this patch simple for ease of review.
2023-12-03Revert "Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are ↵Samuel Thibault
byte aligned" This reverts commit 2db6b9b7b23b3bab944665b3b6012d24dd425d97.
2023-12-03Revert "x86_64: Support 8 byte inlined port rights to avoid message resizing."Samuel Thibault
This reverts commit 29d4bcaafc4c2040df27a6247603c68e7757205c.
2023-12-03Xen: fix buildSamuel Thibault
2023-12-03Fix 32-on-64: Fix missing es pushSamuel Thibault
push %es actually cannot be compiled
2023-12-03x86_64: Support 8 byte inlined port rights to avoid message resizing.Flavio Cruz
If a port is inlined in a message, the user has to use mach_port_name_inlined_t to define each port. Out of line memory continues to use mach_port_name_t since that memory has to be copied to the kernel anyway. Both copyinmsg and copyoutmsg can be reduced to nothing (if we ignore USER32) as a follow up but kept this patch simple for ease of review. Message-ID: <ZWg00XzFPqqL1yF-@jupiter.tail36e24.ts.net>
2023-12-03Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are byte ↵Flavio Cruz
aligned msgt_unused appears right after msgt_size since msgt_size can be reduced to only 8 bits in the future, so we leave the door opened to make msgt_unused 13 bits long. Message-ID: <ZWGT6a6GeqFAtOUn@jupiter.tail36e24.ts.net>
2023-11-29Use MACH_PORT_NAME_NULL and MACH_PORT_NAME_DEAD when checking for null or ↵Flavio Cruz
dead rights Comparing mach_port_name_t that is MACH_PORT_NAME_DEAD against MACH_PORT_DEAD will always return false. Message-ID: <ZWbMBrk7qrl15sKL@jupiter.tail36e24.ts.net>
2023-11-27vm: Coalesce map entriesSergey Bugaev
When - extending an existing entry, - changing protection or inheritance of a range of entries, we can get several entries that could be coalesced. Attempt to do that. Message-ID: <20230705141639.85792-4-bugaevc@gmail.com>
2023-11-27vm: Add vm_map_coalesce_entrySergey Bugaev
This function attempts to coalesce a VM map entry with its preceeding entry. It wraps vm_object_coalesce. Message-ID: <20230705141639.85792-3-bugaevc@gmail.com>
2023-11-19ipc_entry_lookup_failed: Also write message id in bogus port warningSamuel Thibault
It may be enough to get an idea of the origin of the port without having to produce a stack trace.
2023-11-18ipc_entry_lookup: Generalize warnings about bogus port namesSamuel Thibault
Looking up a bogus port name is generally a sign of a real bug, such as a spurious mach port deallocation.
2023-11-12Fix indentSamuel Thibault
2023-11-07mach/message.h: Fix C++98 buildSamuel Thibault
static_assert was introduced in C++11.
2023-11-07Fix assertion for i686 since mach_port_name_t and mach_port_t have the same sizeFlavio Cruz
Message-ID: <ZUlwWGgc2kXNH5dN@jupiter.tail36e24.ts.net>
2023-11-03mach/message.h: Fix C++ buildSamuel Thibault
2023-11-0164bit: Fix user memory leaks on non-inline port arraysSamuel Thibault
The userland allocation is for port names, not ports (as translated below), so we need to allocate less.
2023-10-28locore: Homogeneize 32bit and 64bitSamuel Thibault
2023-10-2864bit: Fix locore buildSamuel Thibault
To allow references to int_stack_base to be quite unconstrained, we need to use 64bit register indexing. CPU_NUMBER_NO_GS was missing a 64bit variant. CPU_NUMBER_NO_STACK assumes being passed a 32bit register.
2023-10-2864bit: Fix types in lock.hSamuel Thibault
simple locks use natural_t, and indexes for bt/bts/btr have to be 32bit.
2023-10-28x86_64/locore.S: Fix int stack checks when NCPUS > 1Damien Zammit
Message-ID: <20231028001347.448826-1-damien@zamaudio.com>
2023-10-27Factorize more push/pop codeSamuel Thibault
2023-10-27locore: Also factorize segment management on i386Samuel Thibault
and harmonize i386/x86_64. This btw fixes not using dx in 32-on-64's alltraps.
2023-10-2732-on-64: Fix missing es pushSamuel Thibault
2023-10-03Fix interrupt handlingDamien Zammit
Logic for interrupts: - interrupt.S raises spl (thus IF cleared) - interrupt.S EOI - interrupt.S calls the handler - for pure in-kernel handlers, they do whatever they want with IF cleared. - when a userland handler is registers, queue_intr masks the irq. - interrupt.S lowers spl with splx_cli, thus IF still cleared - iret, that sets IF - later on, userland acks the IRQ, that unmasks the irq The key to this change is that all interrupts, including IPIs, are treated the same way. Eg. the spl level is now raised before an IPI and restored after. Also, EOI is not needed inside irq_acknowledge. With this change and the experimental change not to dispatch threads direct to idle processors in the scheduler, I no longer observe kernel faults, but an occasional hang does occur. Message-Id: <20231002033906.124427-1-damien@zamaudio.com>
2023-10-03Xen: do not check for multiboot formatSamuel Thibault
The xen build is not multiboot.
2023-10-02Fix non-PAE buildSamuel Thibault
2023-10-01copyinmsg: Check that we have not overflownSamuel Thibault
This if of course too late in case of a failure, but better assert than get awful bugs, and it's really not supposed to happen.
2023-10-01ipc: Fix allocating kernel buffer for storing user messageSamuel Thibault
Otherwise ipc_kmsg_copyin_body will overflow.
2023-10-01mach_msg: Fix checking reception sizeSamuel Thibault
We need to check against the actual user size that will be used, not the current kernel size. Usually userland uses amply-large reception buffer, but better be exact.
2023-10-01Add and use ikm_cache_alloc/free/_trySamuel Thibault
2023-10-01ddb: Make whatis print copy/pastable textSamuel Thibault