Age | Commit message (Collapse) | Author |
|
Talk about "bytes" instead of "addresses" for better clarity.
|
|
|
|
Move the page properties into the new x86/page module, and the virtual
memory layout macros into the x86/pmap module.
|
|
|
|
|
|
|
|
This turns assert.h into a standard header.
|
|
|
|
Make kernel code obtain definitions for the printf family of functions
through the inclusion of the standard stdio.h header.
|
|
The printk functions are close enough to the printf ones to bear the
same names.
|
|
This change prevents the compiler from generating calls to memcpy at a
time when the memcpy function isn't yet mapped.
|
|
|
|
Instead of mixing standard headers and internal redefinitions of standard
types, completely rely on the compiler for what is guaranteed for a free
standing environment. This results in the removal of kern/stddef.h and
kern/stdint.h. The kern/types.h header is reintroduced for the different
(and saner) purpose of defining types not specified in standard C,
namely ssize_t for now.
|
|
Using a single header for all types causing inclusion circular
dependencies isn't very elegant and doesn't scale.
|
|
The segments are modeled after the Linux zones, so let's just use that
name. Besides, it avoids confusion with x86 segments.
|
|
This change was done using astyle, with a few manual editing here and
there.
|
|
Sanitize a call to panic with the same constraints as for printf.
|
|
|
|
Even after its last rework, the biosmem module suffered a number of problems.
First, the biosmem_find_heap function was too naive, and may have fail if the
boot data were not properly sorted. Second, the biosmem_free_usable function
forced the user to save all boot data, and would fail in a way similar to
biosmem_find_heap depending on the memory map, the kernel and the heap
ranges.
This change finally brings a true solution to the problem of early allocation
by properly tracking all boot data in a sorted array. When registering boot
data, the user can mark them temporary, so that they're automatically
unregistered when releasing additional memory once the VM system is ready.
It also makes the biosmem module a lot less dependent on the multiboot
information, using them only to build its internal memory map. The
registration of boot data is now performed by the boot module.
|
|
This function was added with the expectation that it would be used by
another module, but it turns out it's not needed.
|
|
Rename biosmem_panic_toobig_msg to biosmem_panic_too_big_msg.
|
|
Use a column instead of a dash when reporting address ranges for consistency.
|
|
|
|
Explicitely mention that pages returned by the biosmem boot allocator
are part of the direct physical mapping. Harden biosmem_free_usable.
|
|
Make the code clearly state what it's actually doing without
changing what it does much. The most important change is that
biosmem_find_boot_data, a very confusing function, has been
renamed biosmem_find_heap, and was rewritten accordingly.
|
|
For some misguided reason, the previous code assumed that a segment
that didn't overlap with the heap was completely available. Instead
assume it's completely unavailable, and rely on biosmem_free_usable
to add any page that can be used at a later time.
|
|
|
|
Rename this function to biosmem_directmap_end, to better reflect what it
actually does.
|
|
|
|
The main impact of the direct physical mapping on the biosmem module is
that the BIOS-provided memory map must be processed before paging is
enabled, which forces all related code and data to move to the .boot
section.
|
|
|
|
|
|
|
|
Move the error strings to the boot data section. In addition, add some
assembly code to report that a processor doesn't support long mode.
|
|
The original idea was to separate physical page allocation from page list
management, but it doesn't make much sense any more.
|
|
|
|
If passed by the boot loader, the stack tracing module can use the symbol
table to resolve addresses when forging the call trace.
|
|
User task bootstrapping is an init-only process, but it's done with the task
address space loaded, which conflicts with the low addresses the .init section
is linked at. Create a .boot section for the early initialization code and
data, and move the .init section at high addresses.
|
|
Architecture specific code sometimes has constraints on the location of some
data structures in physical memory. This interface provides a simple way to
allocate physical memory from segments that fulfill these constraints. If
they are stronger, or needed by machine independent code, another (more
complicated) interface will be needed.
|
|
Always prefix messages with the current module name.
|
|
There are no precise enough criteria to justify the separation of these
two directories.
|
|
Add amd64 properties, and increase PAE limit to 52 bits.
|
|
This new code handles 32-bit (including PAE, as before) and 64-bit
paging. A few macros and tables only are adjusted depending on the
selected mode.
|
|
Raw multiboot data carry almost exclusively 32-bit values and addresses.
This is a problem as they were also used to store the address of copies
in kernel space. When the kernel is built for amd64, these structures
can no longer store the address of copies. This change fixes the issue
by introducing new structures, independent of any specified format, to
store the relevant boot data during initialization.
|
|
|
|
Merge the .boot section into the .init section, and set the .init
section at physical addresses.
|
|
There is actually already an existing init module, in kern. Avoid name
issues and call the result "boot".
|
|
Merge 32-bit IA-32 (i386) and 64-bit AMD64 (amd64) code into one common
architecture. The amd64 variant isn't functional yet.
|