[J-core] Port Idea: Little Kernel

Cedric BAIL cedric.bail at free.fr
Sat Nov 11 21:49:12 EST 2017

On Sat, Nov 11, 2017 at 5:15 PM, Rob Landley <rob at landley.net> wrote:
> 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.

Indeed, it doesn't :-) Kind of expected actually, but I would prefer a
positiv test. Also for the moment I have choosen -cpu jcore and not
j2. The reason is that the latest discussion we had here, seems to
indicate to me that :
- j1 -> j2 with mul microcoded
- j3 -> j2 + mmu

So none of them will really have a different cpu from qemu point of
view. Maybe a j32 would make sense, if new instruction would only
happear with the j64 (Not just 64bits mode, but SIMD and FPU one too).

> 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 haven't played with the application mode yet. I guess would be also
an option for moving forward my qemu port. That will be easier to get
going with as I already have a toolchain.

> 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. :)

Cedric BAIL

More information about the J-core mailing list