Languages for standalone
Re: Languages for standalone
It is fun! You're welcome.
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
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
-
- Posts: 1
- Joined: Thu Oct 29, 2020 12:59 pm
Re: Languages for standalone
C language doesn't need anything. All of its run-time is pushed into library functions.
Re: Languages for standalone
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
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
Re: Languages for standalone
@Thomas: Nice! Am I making too big a leap in assuming this RISC processor is related to RISC-V?
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
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Re: Languages for standalone
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
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
Re: Languages for standalone
Professor Wirth's Risc CPUs are not related to Risc-V.eekee wrote:@Thomas: Nice! Am I making too big a leap in assuming this RISC processor is related to RISC-V?
Greetings
Peter
Re: Languages for standalone
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
--Thomas
Re: Languages for standalone
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.
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.
This is almost but not literally true. C has a very small runtime; look up crt0. "crt" in fact stands for "C run-time".SamDengmar wrote:C language doesn't need anything. All of its run-time is pushed into library functions.
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
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Re: Languages for standalone
I was in the mood to waste time today.bloodline wrote: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 latereekee 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/
https://wiki.osdev.org/Plain_English_Programming
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
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Re: Languages for standalone
...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").eekee wrote:This is almost but not literally true. C has a very small runtime; look up crt0. "crt" in fact stands for "C run-time".SamDengmar wrote:C language doesn't need anything. All of its run-time is pushed into library functions.
Cheers,
bzt
Re: Languages for standalone
So how do you set up the stack, then? That's one of crt0's jobs.
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
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Re: Languages for standalone
The program loader should set up a stack. crt0 would not allocate the stack, as crt0 needs a stack itself .eekee wrote:So how do you set up the stack, then? That's one of crt0's jobs.
Re: Languages for standalone
Y'all are making me think!
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.
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 — 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
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Re: Languages for standalone
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.
Re: Languages for standalone
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.