-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NICTA Technology Integration #9
Comments
Mirrored the Pistachio 1.1 archive to https://github.com/vmlemon/NICTA-Pistachio-Devel-1.1-Version-0. |
Not sure if it's perfectly synchronised with master, but I've imported the Pistachio 1.1 files, into a directory at https://github.com/vmlemon/Orion/tree/NICTA_Pistachio_Mainline_FCL. None of this code has been touched, and it's unknown as to how much, if any can be reused in Orion, given the differing development ages of both forks of Pistachio, although we could try building it, if we had a SCONS implementation (although NICTA say that their release isn't supposed to be usable, outside of Iguana). |
Looking at the low-hanging fruit, in the NICTA package:
We can dispose of the redundant copy of AUTHORS, since they're identical. We don't have Their package had some documentation, that we didn't, which could be useful, for historical purposes, so I merged it into our repository:
|
Pushed those into the branch, so we have a delta of:
They have more/different tools, to us:
Moved across the profiler, since we don't have one, so the tools delta is now:
|
So, we remove their copy.
Pull across Their
|
Their
Their
Their ``mkdirhier``` is different, why?
|
Looking at the NICTA version of mkdirhier, it looks like they fixed a bug (failure to create parent directories, with a one-line patch):
Since it makes logical sense, and it doesn't knowingly-break things, I've upstreamed it into Orion. What a difference 6 years makes! |
Moved over their
Going to just move this over, as The only directories left to contend with, are now contrib, and kernel. |
Ported the master kernel Makefile - mostly just included some extra dependency-tracking logging, that could be useful to us, and pulled over the Alpha/SPARC64/Itanium MakeFile templates, as well as the SPARC/OF platform enablers. |
Moved over the sample configs for Miata, PLEB/2, Tsunami, U4600, i2, IA32, LN2410SBC, SiByte, OpenFirmware/G5, PSIM, SA1100 |
After doing all of this, so far, the PPC64 port still gets to:
|
What is interesting, is the contents of kernel/src/glue/v4-powerpc64, in both trees:
Would be interesting to know where the header files come from in our version, and why they're missing, from the NICTA one... |
Focussing on asmsyms.cc, we can see that they're identical, in both versions:
exception.cc has changed, in NICTA's version: [root@fedora28 Orion]# diff pistachio--devel--1.1--version-0/kernel/src/glue/v4-powerpc64/exception.cc kernel/src/glue/v4-powerpc64/exception.cc 29c29 < * $Id: exception.cc,v 1.17 2004/06/04 06:38:41 cvansch Exp $ --- > * $Id: exception.cc,v 1.18 2006/11/17 17:04:18 skoglund Exp $ 35c35 < #ifdef CONFIG_DEBUG --- > #if defined(CONFIG_DEBUG) 64,65c64 < // if( current->get_exception_handler().is_nilthread() ) < if (EXPECT_FALSE( current->get_scheduler().is_nilthread() )) --- > if( current->get_exception_handler().is_nilthread() ) 97,100c96,97 < // tag = current->do_ipc( current->get_exception_handler(), < // current->get_exception_handler(), timeout_t::never() ); < tag = current->do_ipc( current->get_scheduler(), < current->get_scheduler(), timeout_t::never() ); --- > tag = current->do_ipc( current->get_exception_handler(), > current->get_exception_handler(), timeout_t::never() ); 103c100 < if (EXPECT_TRUE( !tag.is_error() )) --- > if( !tag.is_error() ) 129c126 < current->switch_to_idle(); --- > get_current_scheduler()->schedule(get_idle_tcb(), sched_handoff); 211c208 < #ifdef CONFIG_DEBUG --- > #if defined(CONFIG_DEBUG) 234c231,233 < pg.set_entry( space, size, virt_to_phys((addr_t)dar), true, true, true, true ); --- > pg.set_entry( space, size, virt_to_phys((addr_t)dar), > 7, pgent_t::l4default, true ); > 254c253 < ASSERT( NORMAL, !(is_kernel && space->is_cpu_area ((addr_t)dar)) ); --- > ASSERT( !(is_kernel && space->is_cpu_area ((addr_t)dar)) ); 258a258,272 > > // Is the page hash miss in the copy area? > if( EXPECT_FALSE(space->is_copy_area((addr_t)dar)) ) > { > enter_kdebug( "Page table needs to be fixed for copy area" ); > // Resolve the fault using the partner's address space! > tcb_t *partner = tcb_t::get_tcb( tcb->get_partner() ); > if( partner ) > { > addr_t real_fault = tcb->copy_area_real_address( (addr_t)dar ); > if( partner->get_space()->handle_hash_miss(real_fault) ) > except_return(); > } > } > 294c308 < #ifdef CONFIG_DEBUG --- > #if defined(CONFIG_DEBUG) 311,323d324 < case L4_TRAP_KSET_THRD_NAME: < { < space_t * dummy = NULL; < threadid_t tid; < word_t *name; < < tid.set_raw (context->r3); < < name = (word_t*) (dummy->get_tcb(tid)->debug_name); < name[0] = context->r4; < dummy->get_tcb(tid)->debug_name[15] = '\0'; < } < break; 391c392,393 < true, true, true, true ); --- > 7, pgent_t::l4default, true ); > 462c464 < ASSERT(NORMAL, !ppc64_is_kernel_mode(context->srr1)); --- > ASSERT(!ppc64_is_kernel_mode(context->srr1)); 474,475c476 < // if( current->get_exception_handler().is_nilthread() ) < if (EXPECT_FALSE( current->get_scheduler().is_nilthread() )) --- > if( current->get_exception_handler().is_nilthread() ) 511,514c512,513 < // tag = current->do_ipc( current->get_exception_handler(), < // current->get_exception_handler(), timeout_t::never() ); < tag = current->do_ipc( current->get_scheduler(), < current->get_scheduler(), timeout_t::never() ); --- > tag = current->do_ipc( current->get_exception_handler(), > current->get_exception_handler(), timeout_t::never() ); 517c516 < if (EXPECT_TRUE( !tag.is_error() )) --- > if( !tag.is_error() ) 522,532d520 < < // Results < context->r3 = current->get_mr( EXCEPT_IPC_SYS_MR_R3 ); < context->r4 = current->get_mr( EXCEPT_IPC_SYS_MR_R4 ); < context->r5 = current->get_mr( EXCEPT_IPC_SYS_MR_R5 ); < context->r6 = current->get_mr( EXCEPT_IPC_SYS_MR_R6 ); < context->r7 = current->get_mr( EXCEPT_IPC_SYS_MR_R7 ); < context->r8 = current->get_mr( EXCEPT_IPC_SYS_MR_R8 ); < context->r9 = current->get_mr( EXCEPT_IPC_SYS_MR_R0 ); < context->r10 = current->get_mr( EXCEPT_IPC_SYS_MR_R10 ); < context->r0 = current->get_mr( EXCEPT_IPC_SYS_MR_R0 ); 535a524,534 > > // Results > context->r3 = current->get_mr( EXCEPT_IPC_SYS_MR_R3 ); > context->r4 = current->get_mr( EXCEPT_IPC_SYS_MR_R4 ); > context->r5 = current->get_mr( EXCEPT_IPC_SYS_MR_R5 ); > context->r6 = current->get_mr( EXCEPT_IPC_SYS_MR_R6 ); > context->r7 = current->get_mr( EXCEPT_IPC_SYS_MR_R7 ); > context->r8 = current->get_mr( EXCEPT_IPC_SYS_MR_R8 ); > context->r9 = current->get_mr( EXCEPT_IPC_SYS_MR_R0 ); > context->r10 = current->get_mr( EXCEPT_IPC_SYS_MR_R10 ); > context->r0 = current->get_mr( EXCEPT_IPC_SYS_MR_R0 ); |
Some init.cc code changed:
Need to see if the API also changed. |
MemControl gets minor change:
Was there a bug, in the original version? |
An API change was introduced, affecting pghash:
|
Minor change:
|
Identical files:
space.cc changed, a lot:
|
Bit-exact:
Bit-exact:
Syscall ABI change:
|
Moved the glue code for Alpha, ARM, IA64, SPARC64, and MIPS64, from NICTA |
Moved the arch code for Alpha, ARM, IA64, SPARC64, and MIPS64, from NICTA |
Attempt at building POWER4 config:
|
Second attempt, after installing ed:
|
Another attempt:
|
With an older GCC, we get:
|
Looks like the NICTA folks put the kernel includes in a different place, and also provide a modified version of mkasmsym.h:
Could this be the key to making the PPC build advance? |
We seem to use /root/Orion/kernel/src/generic/mkasmsym.h, which dates from 2006, but the NICTA one seems to be from 2004. Might set that aside, and look at space.h, for now, instead. |
[root@fedora28 include]# ls //space.h |
We get a little further, after some more hacking - now, the XICS RTC driver fails to build, with:
|
Worked around the cpuid_t, with a typedef, but I don't quite understand the deal with pgent_t::set_entry, since the API seems to be inconstantly-used, and undocumented, and probably in flux. Set it to something random, derived from the existing code, to bypass it, but it's not a nice way to play. :( |
Spent much of last night, trying to merge in more of their code, although a lot is now broken, on NICTA_Pistachio_Mainline_FCL, past 39d8dac. For instance, x86 builds are also broken:
|
After installing GCC/G++ 6.x:
|
On NICTA_Fix_FCL, we get:
|
Looks like 69e9f23, and f98a648 seem sane (they let us build XICS), but we broke things, by replacing exregs. |
f98a648 gives us:
|
After doing the express patches, to close off #1, the current status is now:
|
Looks like some of the older ports got removed from mainline Pistachio, in l4ka/pistachio@a0a8042 |
In support of #3, I moved over the IA32 arch, and glue directories, and moved some headers around, which gets x86 a little further, but 32-bit, and 64-bit support are broken, still, in different ways. (Master actually gets closer to building, but it's older code, without all of the NICTA components). |
Everything done on this, so far, has been merged into master, and backpropagated into other working branches. Please note that a lot of things are broken, but things are at the stage, now, where it's easier to just have one running branch, for working on this. |
Both versions of CML2 are identical:
|
In the NICTA tree, we had a few files that either haven't been comprehensively-checked, or could be problematic for merging, so I've put them into Right now, a lot of things are broken, and some features may not work, some of our original files got lost, during merges, and it will probably be necessary to fix the build system, headers, and various source files, to fit everything together. The process of massaging everything will take a long time, and require looking through files, with a fine-toothed comb, but since the bulk of ingesting this reasonable-sized code drop into the Orion codebase is complete, I'll be closing this bug. The rest of that work will be tracked in future issues, and in global project #5. |
Kicking a dead horse, but now, pretty much all of the old NICTA includes, tools, documentation, and build system stuff has been merged in, although quite a lot is still broken. The Enryo stuff was also merged in, and uprevved with some fixes for x86-64, that various folks had done, to forks of the main Pistachio repository, so in the |
Several years ago, NICTA released a fork of L4Ka::Pistachio (see https://web.archive.org/web/20130521002051/http://www.ertos.nicta.com.au/software/unsupported/), that added support for several architectures (Alpha, ARM, Itanium, MIPS64, and SPARC64), as well as a suite of components (Iguana, Wombat, Kenge, and Darbat, amongst other things), that could be interesting to stripmine for code, and ideas.
Since they originated the PowerPC 64-bit port, it could help us track down some of the missing code, that's plaguing current attempts at complation...
Sadly, ERTOS (the department of NICTA responsible for L4 R&D) appears to have disbanded, and suddenly replaced by "Data61" (apparently, a division of Australia's CSIRO), and all of their excellent work has mostly vanished from the Web, although Archive.org have bits of it. :(
Presently, the code on GitHub, at https://github.com/l4ka/pistachio was last touched in 2014, before the developers seemingly abandoned it, whilst the NICTA code seems to date from around 2005-2007, and completely replaces much of the build system, so we can't just drop it in, as a direct "engine swap".
So that it doesn't disappear again, I'm attaching it to this bug report, and I'll probably unpack it into a branch, later on...
pistachio--devel--1.1--version-0.tar.gz
I also have the 55.1MB iguana-project--devel--1.1--version-0.tar.gz archive, which is too large to attach to this report.
We also used parts of it in i9, and Enryo, although I believe that there were some bugs, and shortcomings, due to it being designed for use in embedded systems, and parts of it being cribbed from BSD code, in an idiosyncratic fashion.
The text was updated successfully, but these errors were encountered: