Enquiry
Re:Enquiry
I have no doubt that it did, well ok, one doubt: Your code does not include the boot sector signature, how was it accepted as valid by the BIOS?
Edit:
I do have to say though, if you can honestly say that you know what each line of that code does, how they work together and why they're necessary to achieve its end result and four hours before writing it you had never touched assembly before, then you are a rather quick learner.
Edit:
I do have to say though, if you can honestly say that you know what each line of that code does, how they work together and why they're necessary to achieve its end result and four hours before writing it you had never touched assembly before, then you are a rather quick learner.
Re:Enquiry
Ah looks like some old builds of KOS i made. good times good times...
anyway....Printing a message does not mean it is an OS. It is a kernel though.
An OS is defined as:
"Software designed to control the hardware of a specific data-processing system in order to allow users and application programs to make use of it."
I dont think printing a message allows a user to make use of the hardware.
[hr]
Also..isnt a Cisco PIX Firewall 501 a little overkill?
anyway....Printing a message does not mean it is an OS. It is a kernel though.
An OS is defined as:
"Software designed to control the hardware of a specific data-processing system in order to allow users and application programs to make use of it."
I dont think printing a message allows a user to make use of the hardware.
[hr]
Also..isnt a Cisco PIX Firewall 501 a little overkill?
Re:Enquiry
I used this program to write to sector 1 of the a:
Its not that hard to learn code.
After looking at the parameters, I added them one at a time, and kept running the program, and watched for the differences it makes. From this I learnt what each code does, and now understand some basics. Its pretty simple actually, all logic. Just a matter of learning and coding.
Much time required. Years...
Yes, I see what you mean by non operating system.
Who cares, it runs by itself, that is all I was after. LOL
What do you mean by over kill?
Its not that hard to learn code.
After looking at the parameters, I added them one at a time, and kept running the program, and watched for the differences it makes. From this I learnt what each code does, and now understand some basics. Its pretty simple actually, all logic. Just a matter of learning and coding.
Much time required. Years...
Yes, I see what you mean by non operating system.
Who cares, it runs by itself, that is all I was after. LOL
What do you mean by over kill?
Re:Enquiry
You didn't answer my boot signature question. Also, when you say parameters are you referring to the instruction operands or the instructions themselves?
Re:Enquiry
Kolusion wrote: Its not that hard to learn code.

Good luck, but lose the arrogancy, it isn't helping you.
Re:Enquiry
Hi,
For example, there's some Compaq computers that will refuse too boot if the first instruction isn't a jump (just like a large number won't boot if the boot signature isn't at offset 0x01FE in the boot sector). Also you shouldn't rely on the BIOS to leave DS (or ES, FS, GS) in a sane state, or expect the stack to be usable and where you want it.
Taking into account these things gives:
Then a better knowledge of the 80x86 instruction set would help improve performance and reduce the code size. An small example here would be the "lodsb" instruction:
I must say though, in only 4 hours you've done quite well
. Now all you need is another 20 thousand or more lines of code...
Cheers,
Brendan
That is quite correct - learning and writing code is easy. The hard part is writing good quality code that also happens to work on all 80x86 compatible computers with all their quirks.Kolusion wrote:Its not that hard to learn code.
For example, there's some Compaq computers that will refuse too boot if the first instruction isn't a jump (just like a large number won't boot if the boot signature isn't at offset 0x01FE in the boot sector). Also you shouldn't rely on the BIOS to leave DS (or ES, FS, GS) in a sane state, or expect the stack to be usable and where you want it.
Taking into account these things gives:
Code: Select all
org 0x7C00
jmp START
START:
cli
mov ax,0x0000
mov ss,ax
mov sp,0x7C00
sti
mov ds,ax
mov es,ax
Code: Select all
mov si, msg
mov ah, 0x0E
cld
lodsb
print:
int 0x10
lodsb
test al,al
jne print
Did you perhaps wonder why these other people spent time writing this extra code? One of the problems with 80x86 computers is that each computer is different - code that isn't needed on one computer may be required on another.Kolusion wrote:From looking and running other peoples codes, I found there was much data that was not neccessary to be there. I found this inefficient and learnt I did not have to have it in mine.
I must say though, in only 4 hours you've done quite well

How many OS developer's projects would currently satisfy this definition? I know that after over 10 years (part time) work, mine (or at least the current version) definately does not.Tora OS wrote:"Software designed to control the hardware of a specific data-processing system in order to allow users and application programs to make use of it."
I dont think printing a message allows a user to make use of the hardware.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:Enquiry
...which is 386 or higher. Perhaps he wanted to write a boot sector that works on a 286.Brendan wrote: Then a better knowledge of the 80x86 instruction set would help improve performance and reduce the code size. An small example here would be the "lodsb" instruction...

Every good solution is obvious once you've found it.
Re:Enquiry
LODSB ; AC [8086]
LODSW ; o16 AD [8086]
LODSD ; o32 AD [386]
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Enquiry
Well, it looks like you have your first "hello world boot sector" done. Good. Just make sure you don't try to mess with the HDD's bootsectorFirst off, when I say I programmed an O/S, I was being technical...
It may be like 200 bytes, but HEY, it works, it does load, and these are the elements of an operating system.
I studyied parameters from many sources on the internet, and from little knowledge, I learnt more, example

You might like to get Ralf Brown Interrupt List so that you know all services that hides behind "int xx" instruction and maybe grab a good book about assembly programming in a local bookstore to know what else you could use (e.g. more registers, more instructions, more addressing modes, etc.) for less than 10 EUR.
You might like the "What should i do next" page of the FAQ ...Kolusion wrote: I was wondering if anyone could give me some advice in where to start.
I suggest we end the what is/is not an OS ..." here: we're all in 'early development" of the OS (and some still trying to have their kernel done). We're sounding like saying a builder that just packed three bricks together "nah, you're not building a house! that's just a minimal wall of three bricks!"
Re:Enquiry
Hi all,
Thanks for the feed back and opinions.
Already, alot of you have stated things what I do not understand at present.
I will be offline very soon because I am rebuild my PC, so I dont want to continue on learning until I'm relaxed, so I can focus.
When my system is to a state where I am satisfied in a couple of weeks, I will resume my programming basics.
Speak to you all in the future.
Bye!
Thanks for the feed back and opinions.
Already, alot of you have stated things what I do not understand at present.
I will be offline very soon because I am rebuild my PC, so I dont want to continue on learning until I'm relaxed, so I can focus.
When my system is to a state where I am satisfied in a couple of weeks, I will resume my programming basics.
Speak to you all in the future.
Bye!

Re:Enquiry
Ok, I may not have been the most diplomatic person here (in fact, I can guarantee that I wasn't), but that is just uncalled for. If you think this is so lame then just ignore it, it would take a lot less effort on your part and maybe you might do something productive? Just maybe?
(Moderator's note: Above paragraph refers to a deleted post. -- Solar)
Kolusion:
The fact that you have faced down our criticism is a good sign in regards to your will to achieve this, congratulations and I hope we haven't been too harsh in our tendency towards cynical realism. I hope the links and advice we have provided will prove useful to your learning when you return.
(Moderator's note: Above paragraph refers to a deleted post. -- Solar)
Kolusion:
The fact that you have faced down our criticism is a good sign in regards to your will to achieve this, congratulations and I hope we haven't been too harsh in our tendency towards cynical realism. I hope the links and advice we have provided will prove useful to your learning when you return.
Re:Enquiry
You are correct, but if you make a FAT12 bootloader you will need some data in there. This data is the Boot Parameter Block, or BPB, and it takes up quite a bit of space (at least, considering that you only have 512 bytes to begin with). If you don't have it, your disk will not be recognized properly by Windoze.From looking and running other peoples codes, I found there was much data that was not neccessary to be there. I found this inefficient and learnt I did not have to have it in mine.
Also, as mentioned before, bytes #511 and #512 must be 55h and AAh, respectively. This is called the boot signature, and most (in fact, AFAIK all) BIOSes will not load your bootloader if there is no boot signature. Thus, you have to put that there as well. As for the Compaq computers which expect the first instruction to be a jump, this is OK. You should add it in to be compatible, even if your FS is not FAT (if you are using an FAT file system, the first byte HAS to be a jump, because it is followed by the BPB, which is followed by the code). A jump is only 2 or 3 bytes, and you have 510 bytes to work in (not including the boot signature bytes).
So in some cases, these people may be a bit more knowledgeable than you are, and it might be good to learn from them. And if you don't understand the code, first try RTFMing, and if you find nothing, ask us

- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Enquiry
@NotTheCheat: the usual-and-ever-repeating balance between "flexibility" and "keep-it-stupidly-simple", i'd say.
@Kemp, regarding our own criticism: very true.
@Kollusion, if you're looking for "as simple as it can be" examples, you will like our Baby Steps tutorial. It will show you a collection of bootsectors -- from the simplest to something that starts looking like a bootloader -- and will give you hints about good practice instructions / data that might look unneeded at first sight.
The danger with "remove what seems unneeded" approach is that you'll end up with a bootsector that runs on your machine. Others machines might act differently and might not be as tolerant as yours is. So making a bootloader that runs everywhere requires actually more code than a bootloader for your own machine.
@Kemp, regarding our own criticism: very true.
@Kollusion, if you're looking for "as simple as it can be" examples, you will like our Baby Steps tutorial. It will show you a collection of bootsectors -- from the simplest to something that starts looking like a bootloader -- and will give you hints about good practice instructions / data that might look unneeded at first sight.
The danger with "remove what seems unneeded" approach is that you'll end up with a bootsector that runs on your machine. Others machines might act differently and might not be as tolerant as yours is. So making a bootloader that runs everywhere requires actually more code than a bootloader for your own machine.
Re:Enquiry
I'm afraid that for once I agree with "__pissed", it is blatantly impossible to go from HTML to assembly high flyer in a few hours unless he was some sort of genious. :-\
http://www.emu8086.com/assembly_languag ... al_11.html
Does the code example look familiar...? (Or http://www.howtodothings.com/ViewArticl ... rticle=254, which includes rawwrite)
The only difference is the cold boot stuff is missing and the string being printed is changed. This seems more like someone who thought he was "hot stuff" but then being told he wasn't decided to post a couple of code examples from around the net to prove his 1337ness. ::) Unfortunately the forum seems to have made it easier since it ignores formatting outside of code tags.
http://www.emu8086.com/assembly_languag ... al_11.html
Does the code example look familiar...? (Or http://www.howtodothings.com/ViewArticl ... rticle=254, which includes rawwrite)
The only difference is the cold boot stuff is missing and the string being printed is changed. This seems more like someone who thought he was "hot stuff" but then being told he wasn't decided to post a couple of code examples from around the net to prove his 1337ness. ::) Unfortunately the forum seems to have made it easier since it ignores formatting outside of code tags.