New Here, Help With A Hello World OS Possibly More

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Crybaby
Posts: 4
Joined: Wed Sep 26, 2012 5:57 pm

New Here, Help With A Hello World OS Possibly More

Post by Crybaby »

Here Is Some Hello World Code I Compiled Using Nasm0.98.35 Put The BOOT.bin Threw PowerIso to Run on A Virtual Machine, no Floppy On The Laptop, Heres The Code

Code: Select all

[BITS 16]
[ORG 0x7C00]


MOV SI, HelloString
CALL PrintString
JMP $


PrintCharacter:

MOV AH, 0x0E
MOV BH, 0x00
MOV BL, 0x07

INT 0x10
RET



PrintString:


next_character:
MOV AL, [SI]
INC SI
OR AL, AL
JZ exit_function
CALL PrintCharacter
JMP next_character
exit_function:
RET


;Data
HelloString db 'Hello World', 0
TIMES 510 - ($ - $$) db 0
DW 0xAA55


Is The Code Wrong, The Iso, How Would I Fix the Problem

Heres My Next Step, How To Add A Loading Bar And Picture Then The Same Picture Larger(Or Something Like That)

Here The Loading Bar
Image

And The Picture Small Above And Maybe After As A Background
Image

Possible, What To Learn Where? I Can't Get The Hello World to Work And I Was Hoping For Copy And Past On the Whole Project but it's Not That Easy.. Help, Code, Knowledge And Advice Are Appreciated
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: New Here, Help With A Hello World OS Possibly More

Post by Antti »

It is good that you are interested in OS developing and have found this forum (did you check the wiki?). This hobby is going to be very interesting and rewarding as you get further. First steps are quite difficult but please do not give up.

I am not going to check your code but I will give you an advice: if you ask something here, please try to use a little bit more formal spelling. Beginner questions are allowed per se. Unfortunately, your beginner question and spelling together will inevitably qualify your post as "not the one we would like the forum be filled with."

Check this page:

http://wiki.osdev.org/Category:Babystep

A tip: If you burn your BOOT.bin to CD, it is not bootable.
Congdm
Member
Member
Posts: 48
Joined: Wed Aug 01, 2012 10:53 am

Re: New Here, Help With A Hello World OS Possibly More

Post by Congdm »

Hi,

Your problem is that you aren't familiar with low level programming. At first, you should try to make an assembly program running on DOS.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: New Here, Help With A Hello World OS Possibly More

Post by Kazinsal »

You Can Start By Not Capitalizing Everything Like This.

Then maybe read the wiki's Getting Started and Beginner Mistakes pages.
Crybaby
Posts: 4
Joined: Wed Sep 26, 2012 5:57 pm

Re: New Here, Help With A Hello World OS Possibly More

Post by Crybaby »

Thank you for the advice, I will read up and reply, also if there is points here i'll send you a few
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: New Here, Help With A Hello World OS Possibly More

Post by Kazinsal »

Nope, no karma system of sorts here. It's kind of superfluous when you can look back and see (or just instantly recognize) someone's helpfulness and skill level.
Crybaby
Posts: 4
Joined: Wed Sep 26, 2012 5:57 pm

Re: New Here, Help With A Hello World OS Possibly More

Post by Crybaby »

Got It!
Got some copy and past code, compiled using Nasm, put the bin threw ultraISO, came out as 56k, loaded into virtual box.. and bam, there she was!!! AH I was so happy, now to learn and understand it and move to something bigger. I could not get a screenshot to work but it says 'HELLO WORLD, Crybabys Choice". I was thinking if making it just hello world and posting it, for I could not find one to compare and learn from, and an easy .iso, might ruin the learning proses but just a thought. Heres The Code -

Code: Select all

[BITS 16]
[ORG 0x0000]


          cli
          mov     ax, 0x07C0
          mov     ds, ax
          mov     es, ax
          mov     fs, ax
          mov     gs, ax


          mov     ax, 0x0000
          mov     ss, ax
          mov     sp, 0xFFFF
          sti

          mov     si,msgHello
          call    DisplayMessage
          mov     si, msgEnd
          call    DisplayMessage
          hlt  
   

DisplayMessage:
          lodsb                                       ; load next character
          or      al, al                              ; test for NUL character
          jz      .DONE
          mov     ah, 0x0E                            ; BIOS teletype
          mov     bh, 0x00                            ; display page 0
          mov     bl, 0x07                            ; text attribute
          int     0x10                                ; invoke BIOS
          jmp     DisplayMessage
     .DONE:
          ret          
          

msgHello  db 0x0D, 0x0A, "HELLO WORLD", 0x0D, 0x0A, 0x00          
msgEnd  db 0x0D, 0x0A, "Crybabys Choice", 0x0D, 0x0A, 0x00           
          

          TIMES 510-($-$$) DB 0
          DW 0xAA55
[/color]
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: New Here, Help With A Hello World OS Possibly More

Post by Kazinsal »

Please, no colour tags, it's hard on those of us who use dark themes.
Crybaby wrote:Got some copy and past code
Said code is absolutely useless if you don't know what it does. Finding code on the internet and copying it into whatever context "ruins the learning process".

Also, your NASM version is at least half a decade out of date. The current version is 2.10.05. There have been a lot of improvements since 0.98.35 -- for example, Pentium 4 instruction set and later. Effectively, you're using an assembler that believes that the Pentium III is the best thing since sliced bread. ;)
Crybaby
Posts: 4
Joined: Wed Sep 26, 2012 5:57 pm

Re: New Here, Help With A Hello World OS Possibly More

Post by Crybaby »

True, I'm getting the update. I'm going to start learning but it seems a bit difficult. I don't understand the code but i have been working on computers for awhile now, and i think i can get the hang of it. I was also going to mention why so difficult.. or even is it, but why not by pixels? It's what you see with just working with a simple system, code explained simply you could do anything you see. this pixel black this pixel white at this time? But I'm sure it's easier than I'm thinking. Question - Any suggestions on a read or book that's simple for begginers, also is a picture and loading bar possible in a boot loader, or something to direct it to a file or kernel or something like that, excuse my ignorance just a question.
KidBeta
Posts: 1
Joined: Sun Sep 02, 2012 5:14 am

Re: New Here, Help With A Hello World OS Possibly More

Post by KidBeta »

I would suggest you learn a lot about x86 asm and also the x86 architecture before you start trying to code up a operating system that does even rudimentary tasks. Whilst not impossible it is going to make your life a lot harder not knowing x86 asm. I believe most basic OS dev books assume a understanding of x86 asm before you even start reading. Start by writing small apps on your normal OS and then once your used to that I would suggest you take OS dev slowly, it is not easy.
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: New Here, Help With A Hello World OS Possibly More

Post by Griwes »

Crybaby wrote:True, I'm getting the update. I'm going to start learning but it seems a bit difficult. I don't understand the code but i have been working on computers for awhile now, and i think i can get the hang of it. I was also going to mention why so difficult.. or even is it, but why not by pixels? It's what you see with just working with a simple system, code explained simply you could do anything you see. this pixel black this pixel white at this time? But I'm sure it's easier than I'm thinking. Question - Any suggestions on a read or book that's simple for begginers, also is a picture and loading bar possible in a boot loader, or something to direct it to a file or kernel or something like that, excuse my ignorance just a question.
Yeah, the suggestions were already given.
Blacklight wrote:You Can Start By Not Capitalizing Everything Like This.

Then maybe read the wiki's Getting Started and Beginner Mistakes pages.
This plus entire wiki + brokenthorn.com tutorials + manuals + manuals + manuals + manuals...


It's not your ignorance that is most irritating here; it's your refusal to read.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Post Reply