I was wondering if it was possible to create a new stand-alone operating system with PureBasic?

Code: Select all
; This is a comment
[ORG 0x7C00] ;This just tells the program where it is in the memory. Not important
[BITS 16] ;Not important too.
jmp start ; Jump over BIOS parameter block
start: ;The label for the start of the actual program
push cs ;Put cs onto the stack
pop ds ;Take it out and put it into ds
mov si,Print_loading ;Print loading message
call printstring ;Call is like jump, but it goes back. Like a function
;The complicated bit: Loads the next program
mov ah,02h ;When ah=, int13 reads a disk sector
mov al,4 ;Al is how many sectors to read
mov ch,0 ;The track to read from
mov cl,2 ;Sector Id
mov dh,0 ;Head
mov dl,0 ;Drive (0 is floppy)
mov bx,0x1000 ;Es and Bx put together are where to load the program too (see jmp 0x1000:0x00)
mov es,bx
mov bx,0x00
int 13h ;Int 13 is all functions for disks
mov si,putdot ;Print a ".".
call printstring
jmp 0x1000:0x00 ;Run Bootinit from stack.
printstring: ;Print string routine.
mov ah,0eh ;Mov ah into 0, so int 10 prints
stringloop: ;The following code loads each seperate charcter so it can be printed
lodsb
cmp al,00 ;If al =0, then the string has all been loaded
je endstring
int 10h ;When int 10 is called, and ah=, it prints
jmp stringloop
endstring:
ret ;Ret returns
putdot db '.',0
Print_loading db 13,10,'Loading Pure OS v0.01a...',0
times 425 db 0 ;wastes 425 bytes on purpose, so the sector is full (The program must be 512 bytes long)
I personally don't possess the knowledge nor the capabilities to get a project like this started in the first place, but I foundIf you would really have the needed knowledge you wouldn't ask this question.
This is not quite true (I don't think - but I could be wrong)X wrote:The short answer is yes, you can create an OS with PB. The long answer is ..
1. You need to create a boot loader in pure ASM, and some of th kernel.
2. You need to port over FASM.
3. You need to write your own PB libraries and front end compiler to run against FASM.
Once all of that is completed, then you can use PB to create the test of the OS.