A simple os to edit disk partations

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
trinopoty
Member
Member
Posts: 87
Joined: Wed Feb 09, 2011 2:21 am
Location: Raipur, India

A simple os to edit disk partations

Post by trinopoty »

I don't know if it is the right place to post this question but...
I am writing a very simple o.s. which loads off a floppy. What it does is, it creates, edits partitions on hard drive connected to the system, and also formats the partitions.
Currently what i have is a boot-loader that loads the kernel, initializes GDT, switch to protected mode and executes the kernel. Since I planned it to load only from floppy, the kernel itself contains the code to read/write floppy and support FAT12 file system. I plan it to be extendable with drivers and user applications. The kernel itself will initiate paging and load all the drivers. I am using PE format for all executables and support for ELF can be added too. The os will supports PATA and SATA.
I am having trouble figuring out whether to give PCI support in kernel or as a driver and also if I need to support any ACPI related stuff. I plan on using IOAPIC and LAPIC to handle interrupts. Multiple processors will not be supported.

The second stage bootloader enables A20 gate, installs GDT, loads the kernel at physical address 0x00100000 (1 MB) and transfers control to it. Currently I have a blank kernel.
The memory map exists at physical address 0x00004000. The GDT and IDT exists at 0x00013000.

Any ideas what to do next.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: A simple os to edit disk partations

Post by bluemoon »

You don't need an entire OS to edit partition.
How about let the boot loader load a single-threaded "application", so you can skip most features of a full-featured kernel?
User avatar
trinopoty
Member
Member
Posts: 87
Joined: Wed Feb 09, 2011 2:21 am
Location: Raipur, India

Re: A simple os to edit disk partations

Post by trinopoty »

I consider this as a starting point for a much bigger project i have in mind.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: A simple os to edit disk partations

Post by bluemoon »

I see. For starter, you may restrict your OS to:
- single processor
- 32-bit flat addressing
- support simple scheduling (round-robin is sufficient)

And built a kernel with basic stuff:
- memory management (physical page, logical address space, kmalloc)
- process management, address isolation, resource handling
- simple driver architecture, say, each driver has pre-defined interface per purpose.
- simple VFS layout
- syscall interface
- optionally libc support for convenience

Then you can launch application, and enrich the syscall to provide partition editing feature for application development.

Finally, you can throw away this kernel, as you gained better experience, you can seriously re-design your dream kernel.
User avatar
trinopoty
Member
Member
Posts: 87
Joined: Wed Feb 09, 2011 2:21 am
Location: Raipur, India

Re: A simple os to edit disk partations

Post by trinopoty »

berkus wrote:Do you have something like this in mind?
Yes
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: A simple os to edit disk partations

Post by Brynet-Inc »

Visopsys is a popular OSDev project that turned into a partition manager, Partition Logic.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: A simple os to edit disk partations

Post by rdos »

berkus wrote:
Brynet-Inc wrote:Visopsys is a popular OSDev project that turned into a partition manager, Partition Logic.
Pretty sad destiny for a hobby OS I would say.
Yes, really. I built the partition tools I need to format a new harddrive, add partitions and write the boot loader. This can both be done from command-line, and from applications (it is a library). When things go really wrong, I either remove and recreate the partition, or let Windows repair it. I don't see much need for anything beyond that.
Post Reply