The MASM Forum

General => The Campus => Topic started by: Zen on November 07, 2013, 06:40:50 AM

Title: Interesting Boot Loader Project
Post by: Zen on November 07, 2013, 06:40:50 AM
I found this REALLY COOL article over at CodeProject:
Writing a Boot Loader in Assembly and C - Part 1 (http://www.codeproject.com/Articles/664165/Writing-a-boot-loader-in-Assembly-and-C-Part-1).   
Title: Re: Interesting Boot Loader Project
Post by: Vortex on November 07, 2013, 06:58:50 AM
Hi Zen,

Thanks for the article. :t It demonstrates the usage of both of asm and C to code a bootloader.
Title: Re: Interesting Boot Loader Project
Post by: dedndave on November 07, 2013, 07:02:55 AM
he also did part 2

personally, i don't think a bootloader is any place for a compiler   :P
in IBM-world, you get 512 bytes
speed is not really an issue
but, you better manage every byte carefully
Title: Re: Interesting Boot Loader Project
Post by: Farabi on November 07, 2013, 07:44:15 AM
Quote from: dedndave on November 07, 2013, 07:02:55 AM
he also did part 2

personally, i don't think a bootloader is any place for a compiler   :P
in IBM-world, you get 512 bytes
speed is not really an issue
but, you better manage every byte carefully

512 bytes is only for the loader. Syslinux use the boot loader really to load a system files sized of 512kbytes each. Dont worry about 512-bytes, just make sure it can read the first 100 sector of the rewriteable media. The rest should be fine.
Once Im planning to make my own FAT format, but then, I cancel it, Im confused thinking about the compatibility. Im planning to take 10% of the total size as a FAT, and 4-bytes on each sector point to the next sector for read to form a file.
Title: Re: Interesting Boot Loader Project
Post by: Gunther on November 08, 2013, 05:06:06 AM
Zen,

thank you for the link. It's very instructive also for starters. But I'm amazed already: No one has criticized the fact that he uses AT&T syntax. Strange.

Gunther
Title: Re: Interesting Boot Loader Project
Post by: Vortex on November 08, 2013, 08:20:07 AM
Hi Gunther,

You are right about the AT&T syntax. It's ugly and hard to read.
Title: Re: Interesting Boot Loader Project
Post by: MichaelW on November 08, 2013, 03:15:28 PM
Quote from: Vortex on November 08, 2013, 08:20:07 AM
It's ugly and hard to read.

Yes, potentially more compiler friendly, but ugly and harder to read and type. He could have easily used Intel syntax, also for the inline assembly AFAIK. For an article aimed at beginners Intel syntax would have been a better choice, IMO.
Title: Re: Interesting Boot Loader Project
Post by: Gunther on November 09, 2013, 05:30:08 AM
Michael,

Quote from: MichaelW on November 08, 2013, 03:15:28 PM
Yes, potentially more compiler friendly, but ugly and harder to read and type. He could have easily used Intel syntax, also for the inline assembly AFAIK. For an article aimed at beginners Intel syntax would have been a better choice, IMO.

you're definitely right. Intel syntax is more widespread. On the other hand, AT&T syntax can help one by programming in assembly language for the PowerPC.

Gunther