1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

7 Commits

Author SHA1 Message Date
Achilleas Anagnostopoulos
76f7869f57 vmm: fix some lint warnings (error not checked) 2018-03-22 18:56:28 +00:00
Achilleas Anagnostopoulos
d082a7473a vmm: handle mapping of kernel ELF sections that are not page aligned
The code responsible for mapping the kernel sections worked under the
assumption that the linker would align all sections on a page boundary.
To figure out the page extents for a particular section, the
implementation would round the section VMA down to the nearest page and
add to that the section length rounded up to the nearest page size.

However, some sections (e.g. noptrbss) use 32 byte alignment. Depending
on the section length, the original implementation could in some cases
skip mapping of the last page in the section which would cause a page
fault when its contents were accessed.

The fix for this issue is quite simple: calculate the end page by
rounding up (section start addr + section length) to the next page.
2018-03-22 18:56:13 +00:00
Achilleas Anagnostopoulos
7bcaf0ee8d vmm: implement identity mapping function for contiguous physical mem regions
vmm.IdentityMapRegion can be used by device drivers that want to
establish an identity mapping for a contiguous physical memory block in
order to access some hardware or table.
2017-08-28 07:28:04 +01:00
Achilleas Anagnostopoulos
6195f3fc3b Setup a more granular PDT based on the ELF image section addresses 2017-07-13 06:35:22 +01:00
Achilleas Anagnostopoulos
8ac2ba82cc Implement function for mapping a contiguous physical memory region
The MapRegion function can be used by device drivers to ensure that they
can access memory mapped by the various devices.
2017-07-08 22:17:34 +01:00
Achilleas Anagnostopoulos
eca1f6c26e Change early.Printf calls to kfmt.Printf 2017-07-07 21:37:00 +01:00
Achilleas Anagnostopoulos
8dfc5d4e92 Use pwd as a workspace; move sources to src/gopheros and rewrite imports
By setting up pwd as a Go workspace, we can trim import paths from
something like "github.com/achilleasa/gopher-os/kernel" to just
"kernel".

These changes make forking easier and also allows us to move the code to
a different git hosting provider without having to rewrite the imports.
2017-07-01 20:37:09 +01:00