Author Topic: m68hc11-gcc-3.3.6 on modern Linux  (Read 464 times)

0 Members and 1 Guest are viewing this topic.

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
m68hc11-gcc-3.3.6 on modern Linux
« on: August 01, 2019, 12:06:13 pm »
This is a note for those who are tying to crosscompile gcc for hc11.

so, I have recently switched to a new i9 computer, and yesterday it was time to move my toolchain to a new Linux stage4. I still have projects made on hc11, so it was also time to recompile the cross-compiler toolchain for the new userland.

Code: [Select]
binutils-2.25
gcc-core-3.3.6

binutils had no problem, but compiling gcc-3.3.6 failed of being compiled by gcc-8.3.0, gcc-7.3.0, ... because they both claim that source are too dirty, so at the end of the day, I tried to emerge the old gcc-4.1.2 and found that it has a problem with the new sys-libs/glibc-2.29.

Code: [Select]
2019-07-31 - [ =sys-devel/gcc-4.1.2 ] - failure - root@dev2.30/7.3.0
2019-07-31 - [ =sys-devel/gcc-4.1.2 ] - failure - root@dev2.30/8.3.0
2019-07-31 - [ =sys-devel/gcc-4.1.2 ] - failure - root@dev2.30/8.3.1

After some digging, I found the problem was around "struct ucontext", for which gcc was moaning a lot of errors.

Code: [Select]
--- gcc/config/i386/linux-unwind.h.original     2019-07-31 21:03:38.141755272 -0000
+++ gcc/config/i386/linux-unwind.h      2019-07-31 21:04:02.384757269 -0000
@@ -51,7 +51,7 @@
   if (*(unsigned char *)(pc+0) == 0x48
       && *(unsigned long *)(pc+1) == 0x050f0000000fc0c7)
     {
-      struct ucontext *uc_ = context->cfa;
+      ucontext_t *uc_ = context->cfa;
       /* The void * cast is necessary to avoid an aliasing warning.
          The aliasing warning is correct, but should not be a problem
          because it does not alias anything.  */
@@ -139,7 +139,7 @@
        siginfo_t *pinfo;
        void *puc;
        siginfo_t info;
-       struct ucontext uc;
+       ucontext_t uc;
       } *rt_ = context->cfa;
       /* The void * cast is necessary to avoid an aliasing warning.
          The aliasing warning is correct, but should not be a problem

and specifically the above patch rappresents what has been changed with the new glibc.

Now I have
Code: [Select]
[1] i686-pc-linux-gnu-4.1.2 *
[2] i686-pc-linux-gnu-7.3.0
[3] i686-pc-linux-gnu-8.3.0
[4] i686-pc-linux-gnu-8.3.1

and by choosing gcc-4.1.2 as the "host C compiler" I finally resolved issue and I was finaly able to compile gcc-3.3.6 for hc11  :D

 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 6550
  • Country: us
Re: m68hc11-gcc-3.3.6 on modern Linux
« Reply #1 on: August 01, 2019, 12:16:15 pm »
About 40 years late to the party, but still pretty slick. 

I take it you still need to support these devices. 
How electrically robust is your meter?? https://www.youtube.com/channel/UCsK99WXk9VhcghnAauTBsbg
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68hc11-gcc-3.3.6 on modern Linux
« Reply #2 on: August 01, 2019, 01:39:42 pm »
@joeqsmith
A few of my customers still use HC11 in the oil stations, and weird stations located around the North Pole. I dunno for what, but I know it's the hc11-K4 version able to address up to 1Mbyte of (paged) RAM. It runs to run a micro-scheduler, so each task is physically segregated into a page of ram, with an added 2K dual-port ram used to move data between tasks and between the MPU and the data-concentrator.

Someone has also synthesized an HC11 softcore, and there are also versions "under steroids", with ethernet, DMAs, more uarts, more SPIs, more timers, PLL, etc.

That's cool, the hc11 is still alive  :D
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 5332
  • Country: fr
Re: m68hc11-gcc-3.3.6 on modern Linux
« Reply #3 on: August 01, 2019, 01:55:11 pm »
Oh yeah. I've seen a few devices that still use a 68HC11 core either soft on FPGA or even hard on ASICs. Same for 6502 cores actually...
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 6550
  • Country: us
Re: m68hc11-gcc-3.3.6 on modern Linux
« Reply #4 on: August 01, 2019, 02:02:56 pm »
That's pretty funny that they offer a softcore now.   I rolled my own version of the 11 in the 90s.  It was for the learning experience more than anything.   I was adding some custom instructions but the FPGAs I was using were a bit limited compared with what we have today.  An understatement... :-DD

We used to use the 11E9s.  I've built a few things using them for my own hobby.  The last thing I made was a reverse Ethernet print server.  Hooks to a standard Centronics port and sends the data to a printer over Ethernet.   I used an 8MHz part for that.   After installing an 8MHz  part in the ICE and upping the clock, the ICE wouldn't run.  I ended up adding a crap load of bypass to the circuit boards and maybe some termination to get it working.    :-DD     To have some sort of chance of it working, I tossed the C and rolled it in assembler.    Writing the Ethernet stack in assembler for an 11, was a fun project. 
How electrically robust is your meter?? https://www.youtube.com/channel/UCsK99WXk9VhcghnAauTBsbg
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68hc11-gcc-3.3.6 on modern Linux
« Reply #5 on: August 01, 2019, 03:55:56 pm »
68HC11 core

Which core? that core? or .. something "OpenCore" ?
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 5332
  • Country: fr
Re: m68hc11-gcc-3.3.6 on modern Linux
« Reply #6 on: August 01, 2019, 04:10:25 pm »
I think those were commercial IPs for the HC11, I don't remember from which company.

The 6502 core had been written in-house in VHDL.
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68hc11-gcc-3.3.6 on modern Linux
« Reply #7 on: August 01, 2019, 04:17:03 pm »
The last thing I made was a reverse Ethernet print server

Did you use CS8900 Ethernet chip made by Cirrus Logic, the 5V version?
(guys, be aware that the version for sale at Olimex is the 3.3V version and it's not 5V tolerant)

if so, aren't interrupt bugged when the chip is used in 8bit mode?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf