2001-12-31 07:53:03

by samson swanson

[permalink] [raw]
Subject: prog for no OS. language?

hello,

I had a quick question. Say I want to write a program
to run without an OS, what language/tools do i need?

linus (if you read this) what language/means did you
use to make your terminal emulation program before
linux?


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


2001-12-31 09:43:28

by Brian Litzinger

[permalink] [raw]
Subject: Re: prog for no OS. language?

On Sun, Dec 30, 2001 at 11:52:35PM -0800, samson swanson wrote:
> hello,
>
> I had a quick question. Say I want to write a program
> to run without an OS, what language/tools do i need?

None. Just a cpu, and some toogle switches and lights. 8-)

--
Brian Litzinger <[email protected]>

Copyright (c) 2001 By Brian Litzinger, All Rights Reserved

2001-12-31 11:17:51

by Gábor Lénárt

[permalink] [raw]
Subject: Re: prog for no OS. language?

On Sun, Dec 30, 2001 at 11:52:35PM -0800, samson swanson wrote:
> hello,
>
> I had a quick question. Say I want to write a program
> to run without an OS, what language/tools do i need?

Well, a language which is known by you :) And you should write some
boot loader or something. Imho every beginnger programmer is planning
to write an OS. I did a simple OS too (assembly, nasm). It's quite interesting
task, but it doesn't worth: your OS may be not supported by any others than
you :) [well, for contrast: every OS can begin in this way though]

- Gabor

2001-12-31 15:22:25

by M. Edward Borasky

[permalink] [raw]
Subject: RE: prog for no OS. language?

> hello,
>
> I had a quick question. Say I want to write a program
> to run without an OS, what language/tools do i need?

Well ... *my* personal preference for such things is Forth :-). Forth runs
even on such "tiny" machines as 8051 micro-controllers and there are
probably a dozen good Forth environments, ranging in cost from free to
thousands of US dollars. I have Forth, Inc. SwiftForth for Windows, but for
what you want, you might head over to

http://www.taygeta.com/forthcomp.html

for a comprehensive list of Forth compilers and tutorial information. There
is a Gnu / GPL Forth called "gforth" that will run on Linux (and Windows)
but I've never used it, so I can't comment on it. Other Forth folk have told
me that it's inferior to their own pet versions.

Obligatory warning for those with families: like Linux kernel hacking, Forth
hacking on small computers that can barely support a hex keypad, let alone
an OS, is *highly addictive*! <vbg>

: TARGET FOOT FIND ;
: LOAD BULLET FIND CHAMBER INSERT ;
: SHOOT LOAD TARGET GUN AIM TRIGGER PULL ;

--
M. Edward Borasky

[email protected]
http://www.borasky-research.net

2002-01-01 06:46:00

by Rob Landley

[permalink] [raw]
Subject: Re: prog for no OS. language?

On Monday 31 December 2001 02:52 am, samson swanson wrote:
> hello,
>
> I had a quick question. Say I want to write a program
> to run without an OS, what language/tools do i need?

The first thing you have to write is a boot sector. On Intel, this will be
written in 16 bit assembler.

> linus (if you read this) what language/means did you
> use to make your terminal emulation program before
> linux?

Linus wrote a book, you know. "Just for fun". Amazon should have it...

Or, if you don't have the patience, you could read this:

http://www.li.org/linuxhistory.php

Basically, if you're writing code without ANY OS behind it, you'll be doing
it in assembler, and in order to use 32 bit assembler, you first have to set
up the page tables and interrupt handlers (and know what the A20 line is for,
although you do NOT have to know why the heck it seems to live on the
keyboard controller...), set up your own scheduler (or pretty much disable
interrupts), and basically re-implement a small operating system in order to
get to the point where you can write in some other language (like C).

Linus did it because he was bored, and a college student. It took him 3
months (summer off from school). Why write a term program you boot into?
Becaue he was using minix as his os, and minix sucks at handling interrupts.
You try doing serial IO (to talk to the school's unix box through a modem)
when your serial port drops characters left and right. (I don't think he
even had a 16550a uart at the time... :)

To see what's involved when Linux boots up, read
http://www.moses.uklinux.net/patches/lki.html

You could also go look at the freedos project...

Just getting to 32 bit mode is a bit of an accomplishment, actually. Booting
modern intel hardware recapitulates phylogeny...

Rob

2002-01-03 02:04:47

by T.Raykoff

[permalink] [raw]
Subject: Re: prog for no OS. language?


> On Monday 31 December 2001 02:52 am, samson swanson wrote:
> > hello,
> >
> > I had a quick question. Say I want to write a program
> > to run without an OS, what language/tools do i need?
>

Check out the code for etherboot. It is simpler than the kernel
in many respects, and runs off of the "bare metal".

T.

2002-01-03 02:22:47

by J.A. Magallon

[permalink] [raw]
Subject: Re: prog for no OS. language?


On 20020103 Taavo Raykoff wrote:
>
>> On Monday 31 December 2001 02:52 am, samson swanson wrote:
>> > hello,
>> >
>> > I had a quick question. Say I want to write a program
>> > to run without an OS, what language/tools do i need?
>>
>
>Check out the code for etherboot. It is simpler than the kernel
>in many respects, and runs off of the "bare metal".
>

Or memtest86.

--
J.A. Magallon # Let the source be with you...
mailto:[email protected]
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.18-pre1-beo #3 SMP Thu Dec 27 10:15:27 CET 2001 i686