Commit Graph

22 Commits

Author SHA1 Message Date
Regina König
bcf8171593 Script to debug memtest86plus (efi-version) with GDB in QEMU (#177)
* Add HOW_TO_DEBUG_WITH_GDB file
* Add debug_memtest.sh
* Add debug target to Makefile
* Add binaries and generated files for debugging to gitignore
* Add DEBUG code for memset and memcpy
* Add debug additions to Makefile in build32
* Add debug_memtest.sh to build32

[Lionel Debroux: post-merge fixups: removed a couple whitespace changes and a backup file; undone Github squash merge authorship damage.]
2023-07-30 22:09:25 +02:00
Sam Demeulemeester
9e3958714b
Add support for MMIO UART console (#300)
8/16/32-bit MMIO supported, with configuration options as kernel parameters.
2023-05-12 15:49:00 +02:00
Lionel Debroux
3aeda70e24 Move more of the simple string functions to the header, to allow inlining and further optimization.
Before:
   text    data     bss     dec     hex filename
  10374      19    2712   13105    3331 app/config.o
 106854   26720   13344  146918   23de6 memtest_shared
   8734      19    2712   11465    2cc9 app/config.o
 111310   28392  294688  434390   6a0d6 memtest_shared

After:
   text    data     bss     dec     hex filename
  10105      19    2712   12836    3224 app/config.o
 106580   26720   13344  146644   23cd4 memtest_shared
   8653      19    2712   11384    2c78 app/config.o
 110969   28392  294688  434049   69f81 memtest_shared
2023-01-23 15:49:45 +01:00
Lionel Debroux
c6ff7b1486 Inline the ctype functions, so as to reduce size. 2022-05-21 10:11:45 +02:00
Lionel Debroux
cd68333f86 Get rid of memcpy(), as __builtin_memcpy() is globally smaller - and faster anyway - in all current and foreseeable occurrences. 2022-05-21 10:11:37 +02:00
Lionel Debroux
438201195d Get rid of out of line memset(), as __builtin_memset() is not larger - even usually smaller - and faster anyway in all current and foreseeable occurrences. 2022-05-21 10:11:37 +02:00
Sam Demeulemeester
2a994e7ff5 Various code cleanup following PR review 2022-04-16 13:31:28 +02:00
Sam Demeulemeester
1afcd08951 Realign cache/memory size & bandwidth on line 3-6 for better readability. Add a new flag in printf to add a space between number in unit in %k mode 2022-04-16 13:31:28 +02:00
Sam Demeulemeester
2e048a7c61
Add support for Serial/TTY (#32)
* Add preliminary support for TTY Serial/UART (#15)

* Use shadow_buffer instead of VGA buffer to get a framebuffer-agnostic TTY supprot

* Added menu browsing & inputs from Serial TTY (#15)

* Add fix for degree symbol on TTY. Correct serial.c & serial.h file created with CRLF (#15)

* Move tty_error_redraw() to insure correct redraw when a error occurs

* Many reindent / cleanup

* Various optimization from @martinwhitaker comments
2022-04-04 18:31:54 +02:00
Martin Whitaker
8e600cd9f6 Include our version of string.h, not the build system one. 2022-03-11 18:07:39 +00:00
Martin Whitaker
f6da06b117 Work around the halt/wakeup race in barrier_halt_wait() (issue #13)
There is an unavoidable race between one core halting after decrementing
the barrier count and another core sending it the wakeup NMI. This can
only occur if the core sending the wakeup is running at many times the
speed of the core halting, but it has been observed on an Intel Icelake
mobile processor.
2022-03-08 23:25:16 +00:00
Martin Whitaker
0076e63885 Optimise the barrier wait code.
This reduces the number of instructions between decrementing the count
and halting in the halt wait case. Use the same code for the spin wait
case for consistency.
2022-03-08 23:25:16 +00:00
Martin Whitaker
4078b7760e Faster barrier implementation.
The old barrier implementation was very slow when running on a multi-socket
machine (pcmemtest issue 16).

The new implementation provides two options:

  - when blocked, spin on a thread-local flag
  - when blocked, execute a HLT instruction and wait for a NMI

The first option might be faster, but we need to measure it to find out. A
new boot command line option is provided to select between the two, with a
third setting that uses a mixture of the two.
2022-02-28 22:05:21 +00:00
Martin Whitaker
311a597766 Remove unnecessary memory fence from spin_lock().
The x86 locked instructions enforce total memory ordering, so the
additional fence is redundant.
2022-02-28 22:05:21 +00:00
Martin Whitaker
f8b82eb0bd Exclude copyright notices from Doxygen file descriptions. 2022-02-19 19:56:55 +00:00
Martin Whitaker
76adad2fe6 Add ability to generate internal API documentation using Doxygen. 2022-02-19 16:17:40 +00:00
Martin Whitaker
d09c5ed7b4 Remove the power-saving delay loop from the usleep function.
Now we halt inactive CPU cores, this should no longer be needed.
2022-02-19 13:04:26 +00:00
Martin Whitaker
c23b129e55 Remove delay loop from spinlock wait.
Now we halt CPU cores that are going to be idle for a lengthy period,
we don't need to try to save power in other ways. And anyway, this was
not very effective.
2022-02-12 19:33:53 +00:00
Martin Whitaker
8f1d81b65d Add missing includes of stdbool.h.
To ensure we aren't dependent on the order of inclusion.
2021-12-05 13:50:25 +00:00
Martin Whitaker
808cd46582 Enable entry of address limits greater than 4GB on 32-bit build. 2020-05-29 20:42:26 +01:00
Martin Whitaker
c688a83888 Add string terminator to read_value() buffer. 2020-05-29 20:00:34 +01:00
Martin Whitaker
fbd3376668 Initial commit. 2020-05-24 21:30:55 +01:00