OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 04, 2021 10:11 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Languages for standalone
PostPosted: Mon Oct 26, 2020 6:04 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
It is fun! You're welcome. :D

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Tue Nov 03, 2020 1:06 pm 
Offline

Joined: Thu Oct 29, 2020 12:59 pm
Posts: 1
C language doesn't need anything. All of its run-time is pushed into library functions. :^o :^o


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Tue Nov 10, 2020 7:35 pm 
Offline
Member
Member
User avatar

Joined: Thu Jun 04, 2009 11:12 pm
Posts: 277
Hi,
Oberon
I presented this in college while doing a compiler project.

http://www.projectoberon.net/wirth/Proj ... System.pdf
http://blog.gadgetfactory.net/2016/02/h ... dern-fpga/

--Thomas


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Wed Nov 11, 2020 2:37 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
@Thomas: Nice! Am I making too big a leap in assuming this RISC processor is related to RISC-V?

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Thu Nov 12, 2020 6:24 am 
Offline
Member
Member
User avatar

Joined: Thu Jun 04, 2009 11:12 pm
Posts: 277
Hi eekee,

http://www.projectoberon.com/

The oberon language is not tied to any implementation. Yes, the processor implemented on FPGA is based on Risc5. Dr Wirth designed pascal. It is no surprise than oberon has a pascal flavor.
--Thomas


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Thu Nov 12, 2020 9:34 am 
Offline
Member
Member
User avatar

Joined: Fri Nov 22, 2019 5:46 am
Posts: 576
eekee wrote:
@Thomas: Nice! Am I making too big a leap in assuming this RISC processor is related to RISC-V?

Professor Wirth's Risc CPUs are not related to Risc-V.

Greetings
Peter

_________________
The "fanboy" ;)
https://wiki.osdev.org/User:PeterX


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Thu Nov 12, 2020 12:59 pm 
Offline
Member
Member
User avatar

Joined: Thu Jun 04, 2009 11:12 pm
Posts: 277
The module is named RISC5. I did not dig deep to see if the implementation is actually based on RISCV. Sorry!. During my college years, there was only the native Oberon which ran on bare x86 hardware.
--Thomas


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Wed Nov 18, 2020 8:24 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
Thanks guys.

I'm thinking I might write up a wiki page for Plain English Programming, but I'm awfully tired these days. Maybe when my meds are sorted.

SamDengmar wrote:
C language doesn't need anything. All of its run-time is pushed into library functions. :^o :^o

This is almost but not literally true. C has a very small runtime; look up crt0. "crt" in fact stands for "C run-time".

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Wed Nov 18, 2020 12:20 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
bloodline wrote:
eekee wrote:
You know, I don't think Plain English Programming has much runtime. The package you get includes just 5 files of source, and that's sufficient to rebuild itself. To build other programs with it, you only need to include one of those files. In other words, the entire language runtime is in one file.

https://osmosianplainenglishprogramming.blog/


Goodness! This looks like a fun language, I’ve never heard of it before, thanks for sharing. I’ll have fun reading about this language later :D

I was in the mood to waste time today.
https://wiki.osdev.org/Plain_English_Programming :mrgreen:

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Wed Nov 18, 2020 1:00 pm 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1310
eekee wrote:
SamDengmar wrote:
C language doesn't need anything. All of its run-time is pushed into library functions. :^o :^o
This is almost but not literally true. C has a very small runtime; look up crt0. "crt" in fact stands for "C run-time".
...which is not used in freestanding mode. :-) It's perfectly valid not having "main()" in a C source and implement directly "_start()" instead (conventionally the executable's entry point is "_start", provided by the crt0 in hosted environment, which in turn calls "main").

Cheers,
bzt


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Wed Nov 18, 2020 2:31 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
So how do you set up the stack, then? :) That's one of crt0's jobs.

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Wed Nov 18, 2020 5:44 pm 
Offline
Member
Member
User avatar

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 639
eekee wrote:
So how do you set up the stack, then? :) That's one of crt0's jobs.

The program loader should set up a stack. crt0 would not allocate the stack, as crt0 needs a stack itself :) .

_________________
Currently working on the Nexware project, an attempt to make a less bloated version of GNU. All repos for it can be found at https://github.com/Nexware-Project.


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Wed Nov 18, 2020 6:30 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
Y'all are making me think! :P

Why would crt0 specifically need a stack when it's typically written in assembly language? It's fine for the program loader to provide one, but a bit of searching earlier indicated there are architectures where crt0 has to set up the stack.

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Thu Nov 19, 2020 10:15 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7506
Location: Germany
A freestanding platform might not have a program loader. Your program might be sitting on a ROM, with the CPU starting at a hard-coded address on power-up. BIOS, Kickstart, you name it.) Your platform might not have a stack. I don't know what other architecture it could have, but there is no mention of "stack" in the language standard; it's up to the implementation how it handles automatic variables and returning from functions. If you're thinking about what could be, don't get hung up on what "usually" is...

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Languages for standalone
PostPosted: Thu Nov 19, 2020 1:36 pm 
Offline
Member
Member
User avatar

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 639
bzt was talking about in the case of a loaded program on say Linux. Although an insane kernel may not set up a stack, most kernels do set one up automatically. Systems without a stack will use something else in place. I'm thinking of x86 :) . As for BIOS ROM code, that's sort of different, as generally there called from the CPU. I was talking about the situation bzt was talking about. Also, crt0 doesn't need to set up a stack, because as Solar said, the C spec doesn't mention a stack in it.

_________________
Currently working on the Nexware project, an attempt to make a less bloated version of GNU. All repos for it can be found at https://github.com/Nexware-Project.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 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