[J-core] Port Idea: Little Kernel

Rob Landley rob at landley.net
Sat Nov 11 20:15:28 EST 2017

On 11/10/2017 04:01 PM, Cedric BAIL wrote:
> On Thu, Nov 9, 2017 at 4:24 PM, Rob Landley <rob at landley.net> wrote:
>> Alas, nobody's made time for either yet, I've got my hands full with
>> toybox and $DAYJOB, and if I did wind up with extra time I'd really need
>> to add j-core SOC board and j2 -cpu emulation to qemu.
>> (Qemu commit 143021b26ffe is already making a couple of instructions
>> sh4a-specific. In theory the technique for adding a j2 target wouldn't
>> be that different. Right now we just run qemu under an sh4 kernel with
>> j2 userspace binaries when we want to test in emulation, because then
>> the only j2 userspace instruction missing is cmpxchg, which means
>> futexes don't work. I'm aware there's a kernel patch saying futexes need
>> fixing, but unless Rich gets around to that independently it's behind
>> adding qemu support on my own todo list.)
> I looked at that commit and it sounds quite simple to add the same
> tests for all the other instructions. I was planning to use my JSON
> file for this kind of purpose and generate most of it automatically. I
> will try to look at it this weekend or during next week. Would you
> mind sharing the binary you are using to do your current tests with
> sh2 ? I am guessing I can use a sh4 debian to test if the features
> tests are enable and result in an illegal instruction.

It's been a little while since I've poked at it, let's see...

For the moment I'm using an sh4 kernel with an sh2 userspace (both from
my mkroot project), which is a problem because if -cpu j2 excludes sh4
instructions, that kernel won't run.

Rich said he had a way to run fdpic binaries in qemu-sh4 (application
mode), but when I tried it justnow it said invalid elf image for this
architecture. Possibly I have a stale qemu binary on my netbook, I
should rebuild and see what that does. (More likely last time I built
static pie instead of fdpic...)

I can try to whip up some qemu test images, but don't have them ready
offhand. (In japan, can't go digging through usb backups from here. :)


More information about the J-core mailing list