Error in my kernel written in assembly

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
motosftos
Posts: 13
Joined: Fri Nov 29, 2019 11:26 pm
Libera.chat IRC: MotoSoft

Error in my kernel written in assembly

Post 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?
Last edited by motosftos on Fri Dec 27, 2019 2:09 am, edited 1 time in total.
Octocontrabass
Member
Member
Posts: 6280
Joined: Mon Mar 25, 2013 7:01 pm

Re: Error in my kernel written in assembly

Post by Octocontrabass »

Code: Select all

   int 21H
What is this line of code supposed to do?
MichaelPetch
Member
Member
Posts: 857
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Error in my kernel written in assembly

Post 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
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Error in my kernel written in assembly

Post 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.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
motosftos
Posts: 13
Joined: Fri Nov 29, 2019 11:26 pm
Libera.chat IRC: MotoSoft

Re: Error in my kernel written in assembly

Post by motosftos »

I figured it my self.
My kernel was loaded @ 0x1000
I added an ORG instruction which made evrything correct.
Thanks
Post Reply