pritamzope / OS

Writing & Making Operating System and Kernel parts so simple like Hello World Programs, Starting from writing Bootloaders, Hello World Kernel, GDT, IDT, Terminal, Keyboard/Mouse, Memory Manager, HDD ATA R/W, VGA/VESA Graphics
http://createyourownos.blogspot.com
663 stars 103 forks source link

@Pritam Zope, Assembly codes are 16 or 32 bit? How can i use it as Apps for my OS? #13

Closed ghost closed 3 years ago

ghost commented 4 years ago

Can you please upload your Assembly program without bootloader in a different directory?? Because i am fed up making it as applications for my OS. Drawing rectangles and others in Assembly is 16 bit or 32 bit code??? Please help!!!!!!!!

And: Can i use it as APPS in my OS??

AtieP commented 4 years ago

All the codes that use BIOS interrupts are 16 bit. To convert them to an App instead of a bootloader you can just remove the magic number and the segment assigning.

AtieP commented 4 years ago

Yes, you can use them as apps.

ghost commented 4 years ago

But i tried it, did not work perfectly, especially the CPU info.. its not working perfectly I removed all bootloader code

ghost commented 4 years ago

Should i remove all bootloader code or only the magic code

pritamzope commented 3 years ago

separate out main bootloader that contain magic header

    ; boot loader magic number
    times ((0x200 - 2) - ($ - $$)) db 0x00     ;set 512 bytes for boot sector which are necessary
    dw 0xAA55                                  ; boot signature 0xAA & 0x55

and then include all your separate files before these using %include. you might need to write macros for that. check below link,

https://www.tortall.net/projects/yasm/manual/html/nasm-include.html