Hi there, I am completely new to assembly and OS dev
First off don't OSDev if you don't know assembly, try to learn it, shouldn't take more than
a month to understand simple instructions.
As for the question, here's an outline :
The First Stage loader, is a boot sector (usually), 512 bytes in size loaded at 0x0000:0x7C00,
(I am talking about BIOS Systems and booting from HD/FD, can't assume that the OP is interested in UEFI)
Note : You only have 510 bytes of space for code the last 2 being 0x55AA (BIOS boot signature)
You need a file system, something like FATXX, EXT4, or whatever you prefer, FAT is easier and simple but
has limitations. More information can be found if you care to research. (Hint: INT 0x13)
Once the second stage loader is loaded, you either do one of these 5 things :
1. Switch directly to PM/LM and use your own drivers and load the kernel. (Not recommended for newbies)
2. Stay in RM, load the kernel using int 13h, use a rep movsd (or similar) and copy it to the 1MB mark or whatever. (Highly limiting but easy kernel can't be more than 64KB + BIOS Drivers are crap)
3. Stay in RM, use segmentation techniques to load the kernel, (ridiculous, segment registers are probably the one of the worst, or maybe the worst thing that has ever existed)
4. Use hacks, switch to FRM, or unreal mode and then load the kernel.
5. Make the second stage loader as your kernel
(the simplest method)
After loading the kernel you would switch to your preferred CPU Mode, (if you haven't)
How do I do this in assembly. Thanks
Well, in really simple words, research.
This page may help :
http://wiki.osdev.org/Rolling_Your_Own_Bootloader