[J-core] Port Idea: Little Kernel

Rob Landley rob at landley.net
Sat Dec 23 21:54:48 EST 2017


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

Have you done anything more with this recently? I went back to mkroot
and got it updated to the 4.14 kernel, got arm64 and powerpc64 working,
tested everything with gcc 7.2, and am currently testing with the
upcoming musl-libc release. And thalheim on freenode used my
mcm-buildall.sh script and posted the resulting compiler binaries:

  http://b.zv.io/mcm/bin/

(using the last musl-cross-make release version, so gcc 6.2 and previous
musl release. But much faster than building your own toolchain...)

But we still haven't got a qemu that runs the fdpic binaries:

$
musl-cross-make/bin/sh2eb-linux-muslfdpic-cross/bin/sh2eb-linux-muslfdpic-cc
hello.c --static
$ qemu-sh4 ./a.out
./a.out: Invalid ELF image for this architecture
$ file a.out
a.out: ELF 32-bit MSB  executable, Renesas SH, version 1 (SYSV),
statically linked, not stripped

(Rich says it does for him, I haven't figured out what we're doing
differently.)

In sh4-land the serial port emulation still doesn't do that buffer
timeout interrupt the kernel code started expecting in commit
18e8cf159177 (thread at
https://www.spinics.net/lists/linux-sh/msg51226.html) so the serial
console's just about unusable...

Meanwhile if I build an sh2 kernel, there's no turtle/numato board
emulation. (They're same basic layout to the kernel, just different
peripherals.)

Rob


More information about the J-core mailing list