LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-04-2010, 12:20 PM   #1
joyrock
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Rep: Reputation: 0
Question Copy files to floppy in specified sector


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.

Thanks in advance.............

waiting for response.......
 
Old 01-04-2010, 01:02 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
You are not understanding the concepts of filesystems:http://www.google.com/search?q=fat12...ient=firefox-a
I actually designed my own filesystem for my kernel/os!
 
1 members found this post helpful.
Old 01-04-2010, 01:17 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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 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...

--- rod.
 
Old 01-04-2010, 02:57 PM   #4
joyrock
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
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....

-Joy-
 
Old 01-04-2010, 03:12 PM   #5
joyrock
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
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
Reading about it.. can you suggest any tutorial
 
Old 01-04-2010, 05:39 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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...)

--- rod.

Last edited by theNbomr; 01-04-2010 at 08:07 PM.
 
Old 01-04-2010, 06:17 PM   #7
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
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.
 
Old 01-04-2010, 06:20 PM   #8
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
BTW What ever you do, do not go on the osdev.org forums or you will get flamed and the thread be locked just for asking a stupid questions.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy tar files from unix floppy disk to linux WWII Linux - Newbie 6 07-24-2009 01:48 PM
How to find files and copy the found files to the floppy in one command justmehere Linux - Newbie 11 05-04-2008 11:29 PM
Can't copy files to floppy in GNOME drewblay Linux - Software 4 06-19-2005 05:51 AM
problem copy files to floppy diskette lucent2003 Linux - General 1 01-15-2005 09:29 AM
How do i copy files to a floppy disk?? dsantamassino Linux - Newbie 32 05-30-2003 09:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration