OS>Is it possible?

Just starting out? Need help? Post your questions and find answers here.
embrance
User
User
Posts: 37
Joined: Mon Sep 01, 2003 4:22 am

OS>Is it possible?

Post by embrance »

Is it posible to create an OS,using PB?
scurrier
Enthusiast
Enthusiast
Posts: 169
Joined: Sat May 03, 2003 4:10 am

Post 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
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
embrance
User
User
Posts: 37
Joined: Mon Sep 01, 2003 4:22 am

Post by embrance »

So,in order to create an OS ,i need an assember.Right?
:?
Kris_a
User
User
Posts: 92
Joined: Sun Feb 15, 2004 8:04 pm
Location: Manchester, UK

Post 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:
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
darklordz
Enthusiast
Enthusiast
Posts: 119
Joined: Wed May 21, 2003 1:44 pm
Location: Netherlands
Contact:

Post 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.
Last edited by darklordz on Sun Mar 14, 2004 6:10 am, edited 2 times in total.
Image
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post 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 ;)
embrance
User
User
Posts: 37
Joined: Mon Sep 01, 2003 4:22 am

Post by embrance »

OK guy.Thanks for the really good help! :D
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post 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.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

You'd have to code inline asm specific.. not use PB's ASM output...
My guess is that it WOULD be possible..
Last edited by LarsG on Sun Mar 14, 2004 2:54 pm, edited 1 time in total.

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post 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.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post 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
Post Reply