Page 1 of 1
New Here, Help With A Hello World OS Possibly More
Posted: Wed Sep 26, 2012 6:30 pm
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
And The Picture Small Above And Maybe After As A Background
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
Re: New Here, Help With A Hello World OS Possibly More
Posted: Thu Sep 27, 2012 3:34 am
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.
Re: New Here, Help With A Hello World OS Possibly More
Posted: Thu Sep 27, 2012 4:06 am
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.
Re: New Here, Help With A Hello World OS Possibly More
Posted: Thu Sep 27, 2012 9:34 am
by Kazinsal
You Can Start By Not Capitalizing Everything Like This.
Then maybe read the wiki's
Getting Started and
Beginner Mistakes pages.
Re: New Here, Help With A Hello World OS Possibly More
Posted: Thu Sep 27, 2012 1:53 pm
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
Re: New Here, Help With A Hello World OS Possibly More
Posted: Thu Sep 27, 2012 4:27 pm
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.
Re: New Here, Help With A Hello World OS Possibly More
Posted: Thu Sep 27, 2012 9:46 pm
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]
Re: New Here, Help With A Hello World OS Possibly More
Posted: Fri Sep 28, 2012 12:06 am
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.
Re: New Here, Help With A Hello World OS Possibly More
Posted: Fri Sep 28, 2012 12:59 am
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.
Re: New Here, Help With A Hello World OS Possibly More
Posted: Fri Sep 28, 2012 3:31 am
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.
Re: New Here, Help With A Hello World OS Possibly More
Posted: Fri Sep 28, 2012 4:37 am
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.
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.