Skip to content

[arch][m68k] Add support for plain 68000 exception handling#499

Merged
travisg merged 2 commits intolittlekernel:masterfrom
jrac:68000
Apr 23, 2026
Merged

[arch][m68k] Add support for plain 68000 exception handling#499
travisg merged 2 commits intolittlekernel:masterfrom
jrac:68000

Conversation

@jrac
Copy link
Copy Markdown
Contributor

@jrac jrac commented Mar 23, 2026

Generates per-vector stubs, with each vectory entry pointing to a unique stub slot, which branches to a common handler.

We construct a synthetic exception frame that can be passed to the existing C handlers.

Generates per-vector stubs, with each vectory entry pointing to a unique stub slot, which
branches to a common handler.

We construct a synthetic exception frame that can be passed to the existing C handlers.
Copy link
Copy Markdown
Member

@travisg travisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are a few issues here but otherwise LGTM.

Comment thread arch/m68k/exceptions_asm.S Outdated
Comment thread arch/m68k/exceptions_asm.S Outdated
Comment thread arch/m68k/exceptions_asm.S Outdated
Comment thread arch/m68k/exceptions_asm.S Outdated
- Set up vector 61 (unimplemented integer instruction) only on >= 020,
  since 060 ISP code does not support lower than 020. The ISP code is
  already linked in at build time when targeting 020 or higher.

- Don't implement vector 61 ISP handler on plain 68000. 68060 can be supported by
building for >= 020 or 060 explicitly.
@travisg
Copy link
Copy Markdown
Member

travisg commented Apr 23, 2026

Sorry for taking a while, but this looks goot to me.

I tried to test it on qemu virt machine but it blows up but I figured out that the problem is it tries to copy the vector table over the top of the code itself which is loaded at 0x0. I'll look into moving the load address to a higher spot, either by linking it differently and hoping -kernel honors that, or having it relocate itself to the final location in the top of start.S so that the vector table is free to be at 0. Sadly due to the way the first two vectors work on 68k you can't technically use them for a branch instruction to the real code (though in practice you really could for the qemu virt machine).

Anyway, taking this as-is. Thanks!

@travisg travisg merged commit 59c16ed into littlekernel:master Apr 23, 2026
120 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants