flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Creating a Hello World OS?

Author
Thread Post new topic Reply to topic
saigon



Joined: 29 May 2006
Posts: 62
saigon
Hello!

I have read the FAQ, and also searched the forums many times, but I can't find a solution to this.

I am looking for some code to output "Hello World! Operating System 1.0". Note that it should be cross-platform as I want to create an operating system, but just don't have the kick for the start. I want to create a bootable CD (don't worry, I have plenty CD-Rs) from which the Hello World OS will run.

I am just unable to create something like this, but I am sure I'll create a good operating system once this is done.

Before I create any OS, I have a question: Is it possible to output text using BIOS without writing your own kernel?

Thank you very much! I will appreciate any kind of help!
Post 06 Jun 2006, 12:09
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
example1
C:\FASM TEST.ASM TEST.BIN
put it on a floppy with rawrite.
Code:
 org 0x7C00use16;****************************; Realmode startup code.;****************************start:        xor   ax,ax        mov   ds,ax        mov   es,ax        mov   ss,ax        mov   sp,0x7C00;*************************************; Print message.;*************************************       mov ax,0xB800       mov es,ax       lea si,[msg0]       mov di,(80 * 1 + 2) * 2       mov cx,26       cld       rep movsb            jmp  $ msg0 db "  H E L L O   W O R L D !   "      ;*************************************; Make program 510 byte's + 0xaa55;*************************************times 510- ($-start)  db 0dw 0xaa55     


example2
With bios.
C:\FASM TEST.ASM TEST.BIN
put it on a floppy with rawrite.
Code:
 org 0x7C00use16;****************************; Realmode startup code.;****************************start:        xor   ax,ax        mov   ds,ax        mov   es,ax        mov   ss,ax        mov   sp,0x7C00;*************************************; Print message.;*************************************        mov  si,msg0        call  print        jmp  $;====================================================;;  print.                                            ;;====================================================;print:        mov   ah,0Eh                       ; Request displayagain1:        lodsb                              ; load a byte into AL from DS:SI        or   al,al                         ; Or AL        jz   done1                         ; Jump 0, to label done1        int  10h                           ; Call interrupt service        jmp  again1                        ; Jump to label again1done1:        ret                                ; Return msg0 db " Hello world! "      ;*************************************; Make program 510 byte's + 0xaa55;*************************************times 510- ($-start)  db 0dw 0xaa55     


To make a cd bootable, some how make a bootable floppy image, click in your cd burn software make bootable and point it to the image you have made with the above code.

I would also take a look at MiniDOS code, as its designed as a basic OS tut.
Post 06 Jun 2006, 12:42
View user's profile Send private message Reply with quote
saigon



Joined: 29 May 2006
Posts: 62
saigon
Thank you! I already looked at the MiniDOS thread before posting this one, it seems to be pretty good.

I have a question, though:
For what do I need to do this?
Code:
;*************************************
; Make program 510 byte's + 0xaa55
;*************************************
times 510- ($-start)  db 0
dw 0xaa55 
    


In both examples you posted, you wrote that code in the bottom, but I don't understand for what it is for.

Also, do you know any manual or tutorial where I can learn about how creating an OS with assembly sources? It doesn't mind me if the sources aren't FASM.

Thanks a lot!
Post 06 Jun 2006, 13:39
View user's profile Send private message Reply with quote
WiESi



Joined: 15 May 2006
Posts: 14
Location: Austria
WiESi
A bootloader has to have 512 bytes of size. The first instruction adds zeros to the program until it has 510 bytes. Also a bootloader has to end with 055h and 0aah. This is done by the second instruction.
Post 06 Jun 2006, 14:19
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
WiESi has answered the first ?, as for the second ? this may help
http://www.mega-tokyo.com/osfaq2/index.php/BabyStep
But the best thing is to to get a bootloader like bootprog
http://alexfru.chat.ru/epm.html#bootprog
and assemble your OS as a com or exe, and start by making a realmode OS using bios int, before moving on to Pmode.
Also you could help on someone else OS project to learn (MDos-R)
http://osdev.mike21091.com/
Also theres lots of good doc on bubachs site
http://bos.asmhackers.net/docs/
Hope this helps.
Post 06 Jun 2006, 19:14
View user's profile Send private message Reply with quote
saigon



Joined: 29 May 2006
Posts: 62
saigon
Thanks Dex!
Post 06 Jun 2006, 21:12
View user's profile Send private message Reply with quote
peter



Joined: 09 May 2006
Posts: 63
peter
Post 07 Jun 2006, 01:18
View user's profile Send private message Visit poster's website Reply with quote
The Lightning Stalker



Joined: 07 Jun 2006
Posts: 11
The Lightning Stalker
Surprised Ahh, this may be just the thing I need to display an "insert disc 1" message and then press a key to reboot. This is for a ghost CD set.
Post 07 Jun 2006, 21:12
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.