OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 1:49 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: A recommended Forth for OSDev
PostPosted: Sat Mar 05, 2022 9:26 am 
Offline

Joined: Sat Mar 05, 2022 9:20 am
Posts: 1
Hi all, is there a Forth implementation that's preferably cross platform, which would allow me to compile into a bin so i can start with OSDev? I'm mainly aiming for the x86 but if it supports more than that then i'll gladly take it. It doesn't really have to be an implementation, if it generates a bin then it's enough. :D


Top
 Profile  
 
 Post subject: Re: A recommended Forth for OSDev
PostPosted: Sun Mar 13, 2022 2:50 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
Flamore wrote:
Hi all, is there a Forth implementation that's preferably cross platform, which would allow me to compile into a bin so i can start with OSDev? I'm mainly aiming for the x86 but if it supports more than that then i'll gladly take it. It doesn't really have to be an implementation, if it generates a bin then it's enough. :D

I feel like ought to know the answer to this, but it's just different enough from my goals that I don't. :) I want an interactive Forth where most of the system remains in source code form, so I've hardly looked at compilers. At the moment, I'm planning on using the built-in Forth interpreter in the OpenFirmware of an old Mac just to have a bit of fun. I'd ask in a Forth community; you'll get more knowledgable answers. Running Forth on bare hardware used to be common and there are many free Forth implementations, often licensed to the public domain, some of which compile their own kernel to binary. They differ a lot in features, including language features, so you might have to try a few to find a suitable one.

What sort of features would you want for an OS? Language features are up to you, their usefulness depends on how you code. Many Forths have a built-in assembler; I think that would be good for OS dev, or actually essential if you want to generate a binary straigth from Forth. (If you use a linker, you can use a separate assembler.) Lots of Forths want to load their initial dictionary from a file, but in general, it wouldn't be hard to hack them into bootable form. How about word size? For the PC, there may be more 16-bit than 32-bit Forths, and 64-bit I don't know about at all.

I have thought about using Pygmy Forth for DOS. (Not Pygmy64 which depends on Python.) It's 16-bit and non-standard, but remarkable for its small code size and clean design. It's so small, it doesn't even bother with segments, but you can figure out how to add them from its video code. (It looks like it recycles the right parentheses for variable fetching in assembler, outside of comments.) I didn't use it because it doesn't have some language features I thought I wanted, but now I'm not so sure I want them anyway.

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 36 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group