For the past few months, I've been working on C support in KnightOS. Mainly, I've been working on the C library (libc) and the corelib/userspace library bindings (corelib).

While the CodeWalrus post is more for announcements regarding C support, I plan to use this topic as a support post where I can ask for help, ideas on implementing standard C functions, etc.

Currently, all of corelib is supported, along with most of the system/kernel (color, filestreams, the filesystem, drawing/display, etc) is supported. A fair amount of standard C is also implemented (printf, sprintf, asprintf, among other common std stuff). Also, I plan to add C bindings to the 3D library by matrefeytontias, fx3dlib

A demo game, pong, can be found here: http://www.github.com/sircmpwn/pong



And a demo program showing the use of corelib can be found here: http://www.github.com/maxleiter/corelibcdemo

Currently I'm trying to finish implementing color support (https://sr.ht/dNjy.webm), and then plan to finish up filestream support and will possibly try and attempt to port Ducky (a BASIC-like language) to KOS in C. Any suggestions on a fun project to port/some standard C to implement?

I've also written some KOS C tutorials which can be found here: http://www.knightos.org/documentation/tutorials/getting-started-c/

Huge thanks to everyone that's helped me learn C while working on this, I've learned a lot so far. (Mainly @jacobly and SirCmpwn)
Is it safe to assume you're using SDCC?
elfprince13 wrote:
Is it safe to assume you're using SDCC?

A fork of SDCC, KCC
Very cool! Awesome work!
So, looking at Ducky, it seems like I need to implement setjmp and longjmp. To do so, I think I'll need to implement them with asm. Any suggestions or tips on how to go about this?

EDIT: http://code.metager.de/source/xref/sdcc/sdcc/device/lib/z80/setjmp.s seems like a good resource
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement