1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:47:37 +00:00

PartitionTable: Initial GPT Support, Adding Block Limit

Also added a script to handle creation of GPT partitioned disk (with
GRUB config file). Block limit will be used to disallow potential access
to other partitions.
This commit is contained in:
supercomputer7 2019-10-07 03:12:37 +03:00 committed by Andreas Kling
parent b5a043cf42
commit de49714f36
10 changed files with 273 additions and 13 deletions

View file

@ -2,15 +2,16 @@
// #define OFFD_DEBUG
NonnullRefPtr<DiskPartition> DiskPartition::create(DiskDevice& device, unsigned block_offset)
NonnullRefPtr<DiskPartition> DiskPartition::create(DiskDevice& device, unsigned block_offset, unsigned block_limit)
{
return adopt(*new DiskPartition(device, block_offset));
return adopt(*new DiskPartition(device, block_offset, block_limit));
}
DiskPartition::DiskPartition(DiskDevice& device, unsigned block_offset)
DiskPartition::DiskPartition(DiskDevice& device, unsigned block_offset, unsigned block_limit)
: DiskDevice(100, 0, device.block_size())
, m_device(device)
, m_block_offset(block_offset)
, m_block_limit(block_limit)
{
}