History log of /haiku/src/system/boot/platform/atari_m68k/mmu.cpp
Revision Date Author Comments
# 3b7ddf55 19-Sep-2023 David Karoly <karolyd577@gmail.com>

boot/atari_m68k/mmu: implement missing functions

Change-Id: I7605abc7f5e7b5b15d6dd33ec3bd73777a0804aa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6936
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# b3025a86 26-Oct-2013 François Revol <revol@free.fr>

bootloader: M68K: Fix mmu_free()

Same bug as in ARM code...


# 585830a5 26-Oct-2013 François Revol <revol@free.fr>

bootloader: M68K: s/KERNEL_BASE/KERNEL_LOAD_BASE/


# 32bd2ded 21-Feb-2013 François Revol <revol@free.fr>

bootloader: Fix an overlooked condition in mmu_allocate()

The size variable at this point is actually a page count.
The test should never be true anyway though. Maybe we should use a
pages variable for clarity?


# 6f6d78e8 25-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Cleaned up ELF64 address handling.

* platform_allocate_elf_region() is removed, it is implemented in platform-
independent code now (ELF*Class::AllocateRegion). For ELF64 it is now
assumed that 64-bit addresses are mapped in the loader's 32-bit address space
as (address - KERNEL_BASE_64BIT + KERNEL_BASE).
* mapped_delta field from preloaded_*_image removed, now handled compile-time
using the ELF*Class::Map method.
* Also link the kernel with -z max-page-size=0x1000, removes the need for
2MB alignment on the data segment (not going to map the kernel with large
pages for the time being).


# 88461898 24-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Handle 64-bit load addresses for ELF64 images in the bootloader.

The ELF loader now uses a new platform function, platform_allocate_elf_region,
which returns 2 addresses: the real load address and an address where the
region is mapped in the loader's address space. All of the ELF loading code
has been changed to access the load region through the mapped address rather
than the addresses contained in the ELF image. The ELF64 version of
platform_allocate_elf_region on x86 uses the existing MMU code, which maps
everything at 0x80000000, but returns the correct 64-bit address. The long
mode switch code will just set up the 64-bit address space with everything
remapped at the correct address.


# 17a33898 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Remove phys_addr_range, just use addr_range for both virtual and physical address ranges (as requested by Ingo).


# 192af9e0 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changed addr_range to use uint64.

I've tested this change on x86, causing no issues. I've checked over the code
for all other platforms and made the necessary changes and to the best of my
knowledge they should also still work, but I haven't actually built and
tested them. Once I've completed the kernel_args changes the other platforms
will need testing.


# a4b79a64 02-Nov-2011 François Revol <revol@free.fr>

Allow up to 2MB for the kernel, since it's already over 1MB.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8fe82997 01-Nov-2011 François Revol <revol@free.fr>

Some more tracing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43074 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34dc9962 20-Nov-2010 François Revol <revol@free.fr>

Update copyrights.
Btw Axel, keyboard.cpp (forked from the bios_ia32 one) is still under "OpenBeOS licence" with 2 other copies, I suppose you are ok to change to MIT ?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39548 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e5846dfa 27-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added shared sort_[physical_]address_ranges() to avoid code duplication. Also
fixes the m68k build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36951 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 33fa38c8 12-Oct-2008 François Revol <revol@free.fr>

Avoid using the first physical page. The first 2kB are supposedly protected by the hardware (though it should be accessible by supervisor...) This fixes an segfault.
Now the kernel panics in M68KAtari::InitTimer()... "WRITEME" :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28008 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 57f2b5a0 05-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed the meaning of the {KERNEL,USER}_STACK_SIZE macros to not
include the guard pages. Adjusted the kernel and boot loader code
accordingly -- the guard pages size is added/not removed respectively.
The stack size passed to _kern_spawn_thread() is now the actually usable
size, and it is no longer possible to specify a size smaller than or
equal to the guard pages size.
* vm_create_anonymous_area(): Precommit two pages maximum -- a stack with
only one page usable size obviously doesn't need two pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26819 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d06c88d3 03-Aug-2008 François Revol <revol@free.fr>

Just go for 256MB for transparent translation at boot, 32MB is not enough anyway yet, the kernel wants 16MB just for the heap.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26768 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64ea0b9f 01-Aug-2008 François Revol <revol@free.fr>

- fix early_map
- iospace should now be initialized correctly, at least the kernel goes much further.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26726 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7a1fd4cb 01-Aug-2008 François Revol <revol@free.fr>

allocate all kernel page directories at boot, this will simplify later code a lot.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26721 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 36ee9f5c 24-Jul-2008 François Revol <revol@free.fr>

- use a physical page for natfeat debug output for now
- add 040 cpu and mmu stuff
- use leftover from the page root table to put interrupt vector table to set VBR to


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26627 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0ae19574 23-Jul-2008 François Revol <revol@free.fr>

- Cleanup
- rewrote early_query() to use the TT0 mapping to remove the page_hole stuff.
- fixed natfeat, using a page set up from the bootloader for now as it wants physical address. At least it's enough to see from the debugger:
load kernel...
kernel entry at 8003711a
Welcome to kernel debugger output!
Haiku revision: 26582
PANIC: unknown cpu_type 68040

Welcome to Kernel Debugging Land...
Running on CPU 0
kdebug>


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26599 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ef0397b 20-Jul-2008 François Revol <revol@free.fr>

- cleanups
- disable tracing mmu
- make scratch buffer 8k as it's declared as such... that makes things much better indeed :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26537 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f83297ba 20-Jul-2008 François Revol <revol@free.fr>

cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26533 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74c5e8bd 20-Jul-2008 François Revol <revol@free.fr>

- move VADDR_TO_* to headers
- move part of mmu handling to mmu-dependant files and extend ops
- implemented 040 mmu init. doing so I spotted a bug in ARAnyM which ignored [ID]TT0. Linux likely doesn't use them but I was too lazy touse temporary page tables. I also noticed bitfields were in wrong order, to be fixed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26527 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4401694 17-Jul-2008 François Revol <revol@free.fr>

- fix def
- calculate ram ranges, 1 for st ram, one for fast ram if available. The kernel won't differentiate yet though, we'll have problems with DMA later on...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26480 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 36265c4d 17-Jul-2008 François Revol <revol@free.fr>

- print vars of interest to help setup mem map
- shuffle memory map
- set up transparent translations: first 32MB of RAM and last 16MB for IO space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 931a9e2b 29-Jun-2008 François Revol <revol@free.fr>

Fix build


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26162 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8df3441d 23-Jun-2008 François Revol <revol@free.fr>

- Add 040 mmu support
- Set global mmu ops depending on mmu type.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac00c637 23-Jun-2008 François Revol <revol@free.fr>

Add mmu-specific code, WIP.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26115 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aa84dea3 14-Jan-2008 François Revol <revol@free.fr>

* Comments on how mmu will be set up in the bootloader
* Add aranym native feature helper funcs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23526 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 30b14f3c 12-Jan-2008 François Revol <revol@free.fr>

More #if 0


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23470 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6d45e991 12-Jan-2008 François Revol <revol@free.fr>

#if out x86 stuff to try to build zbeos


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23469 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 246ab5c5 12-Jan-2008 François Revol <revol@free.fr>

* Add atari memory map defs.
* Add osheader defs.
* Check for FPU.
* note on prg vs bootsector.
* mmu stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23468 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dcf911ef 12-Jan-2008 François Revol <revol@free.fr>

* Add function to access the Cookie Jar.
* remove unneeded stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23453 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7f27c6c3 12-Jan-2008 François Revol <revol@free.fr>

* x86 mmu init code, to be changed.
* remove some unneeded stuff in start.
* we just quit the boot prg instead of rebooting (should try Puntaes also)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23440 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b3025a8642645f026efef25e5302e5183113aa59 26-Oct-2013 François Revol <revol@free.fr>

bootloader: M68K: Fix mmu_free()

Same bug as in ARM code...


# 585830a55ef4f6bbbd1559a47a8395b5597906fe 26-Oct-2013 François Revol <revol@free.fr>

bootloader: M68K: s/KERNEL_BASE/KERNEL_LOAD_BASE/


# 32bd2dedd92c994efb538bec7fbc31f5dd5b6122 21-Feb-2013 François Revol <revol@free.fr>

bootloader: Fix an overlooked condition in mmu_allocate()

The size variable at this point is actually a page count.
The test should never be true anyway though. Maybe we should use a
pages variable for clarity?


# 6f6d78e877c1a485d98de60395854a6d6de61c0d 25-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Cleaned up ELF64 address handling.

* platform_allocate_elf_region() is removed, it is implemented in platform-
independent code now (ELF*Class::AllocateRegion). For ELF64 it is now
assumed that 64-bit addresses are mapped in the loader's 32-bit address space
as (address - KERNEL_BASE_64BIT + KERNEL_BASE).
* mapped_delta field from preloaded_*_image removed, now handled compile-time
using the ELF*Class::Map method.
* Also link the kernel with -z max-page-size=0x1000, removes the need for
2MB alignment on the data segment (not going to map the kernel with large
pages for the time being).


# 8846189866301c85683151a54ec88e809333ca7a 24-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Handle 64-bit load addresses for ELF64 images in the bootloader.

The ELF loader now uses a new platform function, platform_allocate_elf_region,
which returns 2 addresses: the real load address and an address where the
region is mapped in the loader's address space. All of the ELF loading code
has been changed to access the load region through the mapped address rather
than the addresses contained in the ELF image. The ELF64 version of
platform_allocate_elf_region on x86 uses the existing MMU code, which maps
everything at 0x80000000, but returns the correct 64-bit address. The long
mode switch code will just set up the 64-bit address space with everything
remapped at the correct address.


# 17a3389882cee19532ddc99bc1f9aa1efd296749 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Remove phys_addr_range, just use addr_range for both virtual and physical address ranges (as requested by Ingo).


# 192af9e0afd2f3d0cbaf5c935480343a70c8ff53 20-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changed addr_range to use uint64.

I've tested this change on x86, causing no issues. I've checked over the code
for all other platforms and made the necessary changes and to the best of my
knowledge they should also still work, but I haven't actually built and
tested them. Once I've completed the kernel_args changes the other platforms
will need testing.


# a4b79a647b73fbbab77e8c56309f72dc4408fe8b 02-Nov-2011 François Revol <revol@free.fr>

Allow up to 2MB for the kernel, since it's already over 1MB.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8fe82997ba025013823fa0fe3f669009780bcd9d 01-Nov-2011 François Revol <revol@free.fr>

Some more tracing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43074 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34dc99625d99a68273ac46eeb33fab18dfba19b7 20-Nov-2010 François Revol <revol@free.fr>

Update copyrights.
Btw Axel, keyboard.cpp (forked from the bios_ia32 one) is still under "OpenBeOS licence" with 2 other copies, I suppose you are ok to change to MIT ?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39548 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e5846dfa616a8ddf80af0c5840991fca4d669031 27-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added shared sort_[physical_]address_ranges() to avoid code duplication. Also
fixes the m68k build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36951 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 33fa38c894b50f751f4295a23d8f3ef4ec4c2e9a 12-Oct-2008 François Revol <revol@free.fr>

Avoid using the first physical page. The first 2kB are supposedly protected by the hardware (though it should be accessible by supervisor...) This fixes an segfault.
Now the kernel panics in M68KAtari::InitTimer()... "WRITEME" :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28008 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 57f2b5a0137be29081ab719ae33ebabddc95b78b 05-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed the meaning of the {KERNEL,USER}_STACK_SIZE macros to not
include the guard pages. Adjusted the kernel and boot loader code
accordingly -- the guard pages size is added/not removed respectively.
The stack size passed to _kern_spawn_thread() is now the actually usable
size, and it is no longer possible to specify a size smaller than or
equal to the guard pages size.
* vm_create_anonymous_area(): Precommit two pages maximum -- a stack with
only one page usable size obviously doesn't need two pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26819 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d06c88d37dd9281fc55eab6b5653c5a26bcae456 03-Aug-2008 François Revol <revol@free.fr>

Just go for 256MB for transparent translation at boot, 32MB is not enough anyway yet, the kernel wants 16MB just for the heap.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26768 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64ea0b9f7496b5641653d35aa1ef6b7abcf1c12d 01-Aug-2008 François Revol <revol@free.fr>

- fix early_map
- iospace should now be initialized correctly, at least the kernel goes much further.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26726 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7a1fd4cbf8a88d0f7139099169f0c17c250270b0 01-Aug-2008 François Revol <revol@free.fr>

allocate all kernel page directories at boot, this will simplify later code a lot.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26721 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 36ee9f5c625f4d16cd61636148f3e8591b5f66a5 24-Jul-2008 François Revol <revol@free.fr>

- use a physical page for natfeat debug output for now
- add 040 cpu and mmu stuff
- use leftover from the page root table to put interrupt vector table to set VBR to


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26627 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0ae1957465684431b9b568cdab1302fce2b4406f 23-Jul-2008 François Revol <revol@free.fr>

- Cleanup
- rewrote early_query() to use the TT0 mapping to remove the page_hole stuff.
- fixed natfeat, using a page set up from the bootloader for now as it wants physical address. At least it's enough to see from the debugger:
load kernel...
kernel entry at 8003711a
Welcome to kernel debugger output!
Haiku revision: 26582
PANIC: unknown cpu_type 68040

Welcome to Kernel Debugging Land...
Running on CPU 0
kdebug>


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26599 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ef0397bc5e916757d29b114b9ca4380efca537f 20-Jul-2008 François Revol <revol@free.fr>

- cleanups
- disable tracing mmu
- make scratch buffer 8k as it's declared as such... that makes things much better indeed :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26537 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f83297ba2d575de1d685386bf86a0fc428a4d169 20-Jul-2008 François Revol <revol@free.fr>

cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26533 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74c5e8bd10dca40d47327c0bc38a186ec986431f 20-Jul-2008 François Revol <revol@free.fr>

- move VADDR_TO_* to headers
- move part of mmu handling to mmu-dependant files and extend ops
- implemented 040 mmu init. doing so I spotted a bug in ARAnyM which ignored [ID]TT0. Linux likely doesn't use them but I was too lazy touse temporary page tables. I also noticed bitfields were in wrong order, to be fixed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26527 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a44016949403743a15d63c519310eee8be0f6800 17-Jul-2008 François Revol <revol@free.fr>

- fix def
- calculate ram ranges, 1 for st ram, one for fast ram if available. The kernel won't differentiate yet though, we'll have problems with DMA later on...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26480 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 36265c4de7f1860ae554f9299d87a39ad1942bf3 17-Jul-2008 François Revol <revol@free.fr>

- print vars of interest to help setup mem map
- shuffle memory map
- set up transparent translations: first 32MB of RAM and last 16MB for IO space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 931a9e2b8886a521248b9095c1e99647203456b4 29-Jun-2008 François Revol <revol@free.fr>

Fix build


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26162 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8df3441d6439f1f0e47fbf0e9c690baf170ae2f9 23-Jun-2008 François Revol <revol@free.fr>

- Add 040 mmu support
- Set global mmu ops depending on mmu type.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac00c6372dbda65e4e50c28899d1063393a85b33 23-Jun-2008 François Revol <revol@free.fr>

Add mmu-specific code, WIP.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26115 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aa84dea3fd211a2b05439a9eb4db12d9074d1b8f 14-Jan-2008 François Revol <revol@free.fr>

* Comments on how mmu will be set up in the bootloader
* Add aranym native feature helper funcs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23526 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 30b14f3c011e05c50984bd43de661a869ec2be78 12-Jan-2008 François Revol <revol@free.fr>

More #if 0


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23470 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6d45e991b5acb921bc52bd078af603686c3feb8f 12-Jan-2008 François Revol <revol@free.fr>

#if out x86 stuff to try to build zbeos


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23469 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 246ab5c53f32d7502293aadaf965f0ec454db116 12-Jan-2008 François Revol <revol@free.fr>

* Add atari memory map defs.
* Add osheader defs.
* Check for FPU.
* note on prg vs bootsector.
* mmu stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23468 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dcf911ef8f3a2576f214829d13fa02d769d6ff02 12-Jan-2008 François Revol <revol@free.fr>

* Add function to access the Cookie Jar.
* remove unneeded stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23453 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7f27c6c3c8644b22dfd406975eafddeeed22a8ca 12-Jan-2008 François Revol <revol@free.fr>

* x86 mmu init code, to be changed.
* remove some unneeded stuff in start.
* we just quit the boot prg instead of rebooting (should try Puntaes also)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23440 a95241bf-73f2-0310-859d-f6bbb57e9c96