Page 1 of 1

Error in my kernel written in assembly

Posted: Sat Dec 21, 2019 5:37 am
by motosftos
I am creating an operating system of my own custom bootloader.
I designed it to get input and give an output(like command-line OS)
but it doesn't seems to be work.

Here is my kernel code.
https://bit.ly/37aki2i

What is wrong in it?

Re: Error in my kernel written in assembly

Posted: Sat Dec 21, 2019 5:47 am
by Octocontrabass

Code: Select all

   int 21H
What is this line of code supposed to do?

Re: Error in my kernel written in assembly

Posted: Sat Dec 21, 2019 7:41 am
by MichaelPetch
I have provided some info in my updated Stackoverflow answer about some of the things wrong with your kernel.asm: https://stackoverflow.com/a/59431113/3857942

Re: Error in my kernel written in assembly

Posted: Sun Dec 22, 2019 11:01 am
by Schol-R-LEA
@motosftos It would help a great deal if you told us what it was doing (or not doing). Is it failing to assemble, and if so, what error messages are you getting from the assembler? Is it assembling, but nothing comes up on the screen when you try to run it? Does it cause a system fault and reboot? Is it running up to a point and then stopping? As things stand, we wouldn't really even know where to look.

It would also help if you could tell us some other details, such as which assembler you are using, what toolchain you are using aside from the assembler (since you usually need more than just an assembler or compiler, and there are several common assemblers such as NASM or FASM which aren't part of a larger toolchain), whether you're using a stock version of the tools or have prepared a cross-development toolchain (trust me, you really, really want a separate set of tools targeting your test platform, rather than your development platform; while the relevant wiki page is title GCC Cross Compiler, the general idea applies to any toolchain, regardless of whether you are using a high-level language or not, as explained on the page Why do I need a Cross Compiler), what OS your development/host system runs, whether you are running on bare metal or in an emulator or virtualizer (and which emu/virt you are using if you are using one), what sort of secondary storage you are booting from (floppy - whether real or virtual - a USB flash drive, a physical hard drive, an SSD, etc.), and how you are preparing the boot image and writing it to the boot drive.
Octocontrabass wrote:

Code: Select all

   int 21H
What is this line of code supposed to do?
Oh, my, is that what i think it is? That's just hilarious. I'm actually impressed at that level of lack of understanding on the OP's part. I mean, we've all been there I suppose, doing something without knowing what it was or why we thought we should, but that's something special.

Re: Error in my kernel written in assembly

Posted: Fri Dec 27, 2019 2:06 am
by motosftos
I figured it my self.
My kernel was loaded @ 0x1000
I added an ORG instruction which made evrything correct.
Thanks