Bootloader: Start work on bootloader
I wrote a fast first stage bootloader and a installer to put it into a disk image.
This commit is contained in:
26
bootloader/installer/GUID.cpp
Normal file
26
bootloader/installer/GUID.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "GUID.h"
|
||||
|
||||
#include <iomanip>
|
||||
#include <cstring>
|
||||
|
||||
bool GUID::operator==(const GUID& other) const
|
||||
{
|
||||
return std::memcmp(this, &other, sizeof(GUID)) == 0;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const GUID& guid)
|
||||
{
|
||||
auto flags = out.flags();
|
||||
out << std::hex << std::setfill('0');
|
||||
out << std::setw(8) << guid.component1 << '-';
|
||||
out << std::setw(4) << guid.component2 << '-';
|
||||
out << std::setw(4) << guid.component3 << '-';
|
||||
|
||||
out << std::setw(2);
|
||||
for (int i = 0; i < 2; i++) out << +guid.component45[i];
|
||||
out << '-';
|
||||
for (int i = 2; i < 6; i++) out << +guid.component45[i];
|
||||
|
||||
out.flags(flags);
|
||||
return out;
|
||||
}
|
||||
Reference in New Issue
Block a user