Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

More on the topic of OS programing

ok, so i write a bit of code with a max length of 512 bytes to the first cylinder first head of a disk, and then boot off of it. The thing is, i'm not really sure what that bit of code should do, can you set up a crude file system in 512 bytes? and do you have something point to another file entirely, the command interpreter such as command.com in ms-dos? an example that could be compiled on a86 would be very helpful :) One other thing, what do i use to write to specific memory locations of a disk? I used to have a good hex editor that could load disks for hex editing but sadly it is lost, so pointing me to a file that could do that would also be extremely helpful. Thanks, MechTech


Comments

  • taking a dump of the mbr and bootsector and use debug to disassemble it. see what it is doing and try the same !!



    ps. look for "GazOs" on gaztek.co.uk !



    bikram




  • taking a dump of the mbr and bootsector and use debug to disassemble it. see what it is doing and try the same !!



    ps. look for "GazOs" on gaztek.co.uk !

    (a small os by Gareth Owen plus some **good** links and info)

    bikram




  • : taking a dump of the mbr and bootsector and use debug to disassemble it. see what it is doing and try the same !!

    :

    : ps. look for "GazOs" on gaztek.co.uk !

    : (a small os by Gareth Owen plus some **good** links and info)

    : bikram

    :

    :



    Bootsector starts at 0000:07C0 on harddisk correct? And how do i dump sectors of the floppy?


  • Your boot loader is (in a perfect world) in the first sector of the disk. (Have it on a floppy disk to simplify things.) You can use rawrite.exe to put it there. (But it adds extra junk to the end of your boot sector. I think it is a bug. This creats two posible problems. If you are trying to make your OS floppy dos compatible it destroys the frist copy of the fat. If you have put one of your os files there it will corrupt it. So, the boot loader is loaded from the first sector to 0000:7c00h and then controll is passed to it. It should do very little more then load your OS from a fixed position on the disk to some memory location. If you are using bios interrupt which im sure you are you will need to worry about the interrupt vector table (IVT). It is at memory location 0 - ? (If you need more infor on the IVT, or any thing else keep on posing. I have more of info on it.) I dont have any examples that would work with the a86 assembler, unless it is compatible with Tasm 5 I can tell you where to get that though if you want. Well, I hope yu dont get turned off on wrighting an OS, many people do. It really isnt that hard (To wright a simple OS) once you get going. Good luck and kee on osting your questions.


  • i realize many people get these crazy ideas and give up after a day but i've got the OS fire in my belly :) If i could just get an example to play with it'd be helpful, i downloaded the GazOS and its nice and simple, exactly what i'm trying to make but the source was a corrupted tar.gz file, (my ms-dos gzip refused to work on it) so i am in need of some source... once i find some example source with an elementary file system and such i should be able to get going.


  • : Bootsector starts at 0000:07C0 on harddisk correct? And how do i dump sectors of the floppy?

    No, the bootsector of the floppy is the first sector (sector 0). It is loaded into memory at

    0000:7c00 by the bios. I have tons of information on the subject.

    I would suggest that you use a bootloader that is compatible with the FAT filesystem since

    this is supported by both DOS and Linux. I have a bootsector for my OS which is smart

    enough to locate a file with a specific name on the disk (in the root directory), load it into memory,

    and begin it executing. If you want to check out my OS so far, you can download the zip which

    includes source at:



    http://expert.cc.purdue.edu/~titzer/redpants



    There is a source file named rpboot.asm that contains the source code which will load a file named

    "startrp.com" into memory and execute it. The source and binary for startrp.com is also included,

    as well as a program that will write the bootsector onto the correct portion of the floppy, and a batch

    file to automate the creation of a bootdisk for my OS.

    I used the source of another bootsector which I downloaded for the bootsector and the source to

    startrp.com is all my work. It doesn't do much yet, but it does give pretty clear examples on how to



    1 - detect a 386 or higher processor

    2 - enter protected mode

    3 - enable the A20 address line to access all of memory

    4 - detect the type of processor through CPUID (detects if CPUID is supported)

    5 - probe physical memory to find installed system memory in megabytes



    It also includes examples on how to print to the screen in protected mode as well as print integers

    to the screen.

    All of the source is NASM compatible. I HIGHLY suggest that you use this assembler.



    I hope at least some of this helps!






Sign In or Register to comment.