Re: [Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-08-07 Thread Philipp Klaus Krause
On 08.08.2014 03:21, Drew DeVault wrote: > On 08/06/2014 01:27 AM, Philipp Klaus Krause wrote: >> On 30.07.2014 04:16, Drew DeVault wrote: I see two options: >> >> 1) sdcc rarely emits jr directly (jr is mostly generated in the >> peephole optimizer), so by using a non-default peephole rule file >

Re: [Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-08-07 Thread Philipp Klaus Krause
On 30.07.2014 04:16, Drew DeVault wrote: > Hi there! I am Drew DeVault, the primary maintainer of KnightOS: > > https://github.com/KnightOS/kernel > > It's a z80 operating system that runs on TI calculators. Currently, both > the kernel and userspace are written entirely in assembly. We would lik

Re: [Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-08-07 Thread Drew DeVault
On 08/06/2014 01:40 AM, Philipp Klaus Krause wrote: > This looks weird to me. You seem to be using memory below the stack > pointer to hold some data (the backup of iy). Any interrupt occuring > during execution of that code could overwrite the data. Hmm, that's a good point. Can you suggest anot

Re: [Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-08-07 Thread Drew DeVault
On 08/06/2014 01:27 AM, Philipp Klaus Krause wrote: > On 30.07.2014 04:16, Drew DeVault wrote: I see two options: > > 1) sdcc rarely emits jr directly (jr is mostly generated in the > peephole optimizer), so by using a non-default peephole rule file > (see pepph-z80.def), one could probably get a

Re: [Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-08-06 Thread Philipp Klaus Krause
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30.07.2014 04:16, Drew DeVault wrote: > One last question: with compilers like gcc, the target can be > specified at configure time, which will set up good defaults for > target architecture and a crt0 and ABI considerations and such. Can > we do so

Re: [Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-08-06 Thread Philipp Klaus Krause
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30.07.2014 04:16, Drew DeVault wrote: > On another note, we also have an ABI that is primarily designed > for assembly users. This means that it assumes the caller is > responsible for managing registers how they please and expects the > caller to

Re: [Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-08-06 Thread Philipp Klaus Krause
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 30.07.2014 04:16, Drew DeVault wrote: > Hi there! I am Drew DeVault, the primary maintainer of KnightOS: > > https://github.com/KnightOS/kernel > > It's a z80 operating system that runs on TI calculators. Currently, > both the kernel and userspace

[Sdcc-user] Supporting an odd ABI for a kernel that wasn't designed for C

2014-07-29 Thread Drew DeVault
Hi there! I am Drew DeVault, the primary maintainer of KnightOS: https://github.com/KnightOS/kernel It's a z80 operating system that runs on TI calculators. Currently, both the kernel and userspace are written entirely in assembly. We would like to provide support for C in userspace for the upcom