ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to make small kernel. I have written many programs and produce many .bin and .o files but what I want that to load every file from a specific location in specific sectors but don't know how to do that in linux , in dos same can be done by debug command.
If It is not possible to achieve the specific location criterion please tell me how can I just copy many files serially to a floppy image.
I have another question that if files are copied in floppy. How could I know in which sector the file has been loaded in floppy so that I can retrieve them by BIOS interrupt INT13.
The directory entry for each file in a FAT filesystem contains a pointer to the first block of data in the file. You can interpret the directory entry accordingly to locate the file data. Of course, this is what an OS already does...
I actually designed my own filesystem for my kernel/os!
Thank you @smeezekitty for your reply I am eager to know what file system you are using for that but again please guide me about the boot loader.What you had used grub or something of your own and do you compile everything in binary format.
Please don't get angry if my questions are stupid. Actually I become confused. It will be great if you can give me a good link which has something more than just to write Hello world boot loader.If you have any written by yourself that would be best....
You can use the dd command to place arbitrary data at arbitrary locations on any writable block device. There is a LQ thread that explains everything you ever wanted to know about dd and more.
The post is really helpful. I think I can now do it.. testing.....
Quote:
You can interpret the directory entry accordingly to locate the file data. Of course, this is what an OS already does
I have no particular favorite, but a Google search for 'fat file system tutorial' yielded a plethora of promising hits. I'm sure if you have access to any old books on MS-DOS internals, you can find some good information. I know of books by Peter Norton and Ray Duncan that probably explain FAT filesystems fairly well. Note that there are a few different flavors for different media sizes (FAT-12, FAT-16, FAT-32...)
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339
Rep:
Quote:
What you had used grub or something of your own and do you compile everything in binary format.
I used a modified boot loader from TheNbomr.
Go look at the source code for the kernel from the link on my sig, notably the bootloader and startup code.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.