flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Problem with booting or the kernel... not sure. |
Author |
|
DragonFire 08 Feb 2005, 00:01
Hello! I recently started developing an Operating System becuase it's something that I have always dreamed of doing.
Now, I "stole" some modified bootloader code from MeOS... it was just lying around on the forum and I figured I would try it out. Now, the bootloader works great. It asks for the kernel filename, I type it in and the loader trys to boot the kernel. But the problem is, it reboots the system. I included the zip file for the OS so if anyone can solve this please do. Heres what I did. I compilied the files into .bin files using the FASM command line tool. Then, I used rawrite to write the BOOT.BIN file to a floppy and then I right clicked the KERNEL1.BIN file and clicked Send to Floppy. To boot the kernel, you have to type KERNEL1.BIN (all caps) when it shows "PhasmaOS Kernel:". Then, hit ENTER (you may have to do it twice.). Thanks!
|
|||||||||||
08 Feb 2005, 00:01 |
|
DragonFire 08 Feb 2005, 02:06
Well, I never coppied the KERNEL to the first sector. Just the BOOT file. Should I have used Rawrite to copy he kernel file too?
BTW, i'll look at Bochs. Thanks for telling me. |
|||
08 Feb 2005, 02:06 |
|
DragonFire 08 Feb 2005, 21:53
Ok. Sorry about double posting, but I can't download Bochs. Can some take a look at the bootloader's source and try and fix what's wrong?
Thanks! |
|||
08 Feb 2005, 21:53 |
|
Octavio 08 Feb 2005, 23:18
You forget to put the kernel name in the boot sector
|
|||
08 Feb 2005, 23:18 |
|
crc 09 Feb 2005, 00:01
Do you pad the name to 12 bytes? If I remember correctly for FAT12 kernel1.bin would appear as: "kernel1 bin" (note the two spaces between "1" and "b".
|
|||
09 Feb 2005, 00:01 |
|
DragonFire 09 Feb 2005, 00:03
I'll look at the bootloader a bit harder and see if I missed something, but you type the name of the kernel to load when the bootloader starts. That way if you have a backup kernel, you can load it when the kernel1 gets corrupt.
EDIT: Whoops, i posted as crc was. I'm new to Assembly... so i'm not quite sure how to do that... or check if it's already done. |
|||
09 Feb 2005, 00:03 |
|
asmdemon 09 Feb 2005, 03:29
If i'm not mistaken, MEOS loads the kernel file to 1000:0000, hence the seg_read_kernel equ 01000h. In your kernel file, you have, "org 0x7C00". This is fine if you make your kernel file the boot sector, but if you want the MEOS boot sector, "BOOTMOSF", to be your boot sector, you will need an org of 0x0000 in your kernel1.bin file. Otherwise all the data and jmps will be to 1000:7C?? instead of 1000:00??.
EDIT: also, check out http://flatassembler.net/examples/phboot.zip. I modified it slightly so you can compile and directly write it with a utility of your choice, or to load it directly into an emulator. Change the data in boot.asm to the following(instead of the XX data that exists on the original example): Code: ;Modified by AsmDemon for direct placement onto floppy drive ;2004-10-18 org 7C00h FATSize equ 6144 ;4096*1.5, max entries*entry size RootSize equ 512 ;we'll read one sector (512b) at once start: jmp byte boot_code nop b08_OEM db 'MSDOS5.0' wSecSize dw 0x0200 ;always must be a multiplier of 32! ;(actually not used, 512b assumed) bSecsPerCluster db 0x01 ;number of sectors per one cluster wResSecs dw 0x0001 ;boot and reserved sectors ;also serves as data sector variable bNumFATs db 0x02 ;number of FATs wRootEntries dw 0x00e0 ;number of root entries wTotSecs dw 0x0b40 ;total sectors bMedia db 0xf0 ;"media descriptor", hehehe wSecsPerFAT dw 0x0009 ;number of sector occupied by one FAT wSecsPerTrack dw 0x0012 ;sectors per track, should be < 64! wSidesPerTrack dw 0x0002 ;number of sides dHiddenSecs dd 0x00000000 ;used only by DOS instead of MBR data dBigTotSecs dd 0x00000000 ;big total sectors (not used) bDrive db 0x00 ;drive number, filled from BIOS db 0x00 bExtBootSig db 0x29 ;extended boot sector signature dSerNum dd 0xBA5EC0DE ;serial number b11_VolumeLabel db 'DecafeLabel' ;volume label, addition to ser.num.? b08_FileSysID db 'FAT12 ' ;completely unused FS signature... |
|||
09 Feb 2005, 03:29 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.