Page 1 of 2

OS>Is it possible?

Posted: Sat Mar 13, 2004 9:09 pm
by embrance
Is it posible to create an OS,using PB?

Posted: Sat Mar 13, 2004 9:12 pm
by scurrier
I don't think so considering it needs an OS to run
but you could make an overlay for an existing OS

Sean

Posted: Sat Mar 13, 2004 9:37 pm
by GPI
Total impossible.

We have in the german forum the same discussion.

PB generate an os-specific code.
Of course, PB has an assembler included, but the generated asm-source-code is os-specific.

Posted: Sat Mar 13, 2004 9:44 pm
by embrance
So,in order to create an OS ,i need an assember.Right?
:?

Posted: Sat Mar 13, 2004 9:51 pm
by Kris_a
Not if you know MACHINE CODE! :D

You could probably find a 'raw' CPU (x86 for example) assembler, but it would probably have to be created or configured specially for making an OS.

alternately, everything I've just said could be a load of rubbish :roll:

Posted: Sat Mar 13, 2004 11:55 pm
by Shannara
PB uses Flat Assembler to compile it's code. You can make OSes with Flat Assembler. Case and point: MenuetOS (http://menuetos.org/). Head over to the Flat Assembler forums found @ http://board.flatassembler.net/index.php if you are interested in OS development with flat assembler. You already have the compiler, as it comes with PB :D Now, if there was a way to alter PB some how, maybe with some internal ASM in order to over-write the OS specific code spit-out? Or maybe alter the ASM output of PB code? It would be kinda interesting just making a bootstrap in pure ASM and use PB for the rest... oOo.

Posted: Sat Mar 13, 2004 11:57 pm
by GPI
When i remember right: When you want to os in Assembler, you must use pure assembler (no libraries, no os-calls). And you must program everything (Ram-Handling, File-Handling, Peripherie-Handling).

BTW: It should be possible to write a OS in C; But it is allways good, when you can Assembler, when you program a OS.

Posted: Sun Mar 14, 2004 6:06 am
by darklordz
if you want to create an os checkout www.emu8086.com it great. A friend of mine and i bought it together, we both are working on a simple os using it. try the demo it ha a 5 kb kernell &loader included!

features:
- Complete software emulation of Intel's 8086 microprocessor.
- Interactive Debugger and Disassembler.
- Step-by-step Assembly Language Tutorials.
- Integrated 8086 ASSEMBLER !
- Advanced Source Editor with Syntax Highlight.
- Everything for coding in Assembly Language. All in one!

Off the site:
Microprocessor Emulator with integrated 8086 Assembler and Free Tutorial. Emulator runs programs on a Virtual Machine, it emulates real hardware, such as screen, memory and input/output devices.

If you just began to study assembly language, then this program is just for you. The source code is assembled and executed on emulator step by step. You can watch registers, flags and memory while your program is running. You'll be amazed how easy it is!

Emu8086 pack combines an advanced source editor with automatic syntax-highlight, assembler, disassembler, software emulator (Virtual PC) with debugger, and step by step tutorials.

Emu8086 is complete 'all in one' solution for coding in Assembly Language.

Emulator runs programs on a Virtual PC, this completely blocks your program from accessing real hardware, such as hard-drives and memory, since your assembly code runs on a virtual machine, this makes debugging much easier.

Arithmetic & Logical Unit (ALU) shows the internal work of the central processor unit (CPU).

8086 machine code is fully compatible with all next generations of Intel's micro-processors, including Pentium II and Pentium 4, I'm sure Pentium 5 will support 8086 as well. This makes 8086 code very portable, since it runs both on ancient and on the modern computer systems. Another advantage of 8086 instruction set is that it is much smaller, and thus easier to learn.

Posted: Sun Mar 14, 2004 6:07 am
by dagcrack
You could make this (not legal!!)

Get a windows PE of any windows version.. and make your OS, then you just boot the modded windows and you boot your "os" its idiotic but thats the best you'll get. (dont ever think on selling it ;)

Posted: Sun Mar 14, 2004 6:25 am
by embrance
OK guy.Thanks for the really good help! :D

Posted: Sun Mar 14, 2004 8:35 am
by GedB
Theres nothing stopping the use of PureBasic for writing an OS.

The libraries are OS specific. These would all need replacing.

All PB does is generate ASM. Anything that can be done in ASM can therefore be done in PureBasic. If there is a feature lacking, then you just have to use inline asm, or write a library function in ASM or even C.

It is difficult, and PB has not been optimised for system programming in the way that C has. However, there is nothing that makes it impossible.

Posted: Sun Mar 14, 2004 10:09 am
by GPI
GedB wrote:However, there is nothing that makes it impossible.
It IS totally impossible to write with PB a os. Even the asm-output is os-spezific code. You can't use it.

Posted: Sun Mar 14, 2004 1:58 pm
by LarsG
You'd have to code inline asm specific.. not use PB's ASM output...
My guess is that it WOULD be possible..

Posted: Sun Mar 14, 2004 2:16 pm
by GedB
Even the asm-output is os-spezific code. You can't use it.
As far as I can see the only os-specific part of the Asm is the win main initialisation.

However, since there are already PB compilers for 3 os (Amiga, Linux and Windows) and at least two processors then these are all minor things.

Possible, yes. Practical... I think not.

..

Posted: Sun Mar 14, 2004 2:38 pm
by NoahPhense
darklordz wrote:if you want to create an os checkout www.emu8086.com it great. A friend of mine and i bought it together, we both are working on a simple os using it. try the demo it ha a 5 kb kernell &loader included!
That's just plain scary. ;)


- np