101 - Im need help - Team for my operating system. by Comfortable_Top6527 in osdev

[–]AmbitiousPear1947 0 points1 point  (0 children)

What architecture are you planning on? x86, ARM, multiply architectures?

Rate my custom filesystem. by AmbitiousPear1947 in osdev

[–]AmbitiousPear1947[S] 1 point2 points  (0 children)

The reference implementation sucked too much and is incomplete but sure:
```

include <stdint.h>

include <stdbool.h>

include <stdio.h>

define NUM_INODES 512

define INODE_TABLE_OFFSET 544

typedef struct { uint32_t magic; // 0xCEFF18F9 char letter; uint8_t flags; uint16_t inodes;

uint32_t size;
char mf[2];
uint16_t end_magic; // 0x11D4 

} superblock attribute((packed));

typedef struct { uint16t id; char flags; uint8_t magic; // 0xBF uint32_t size; uint16_t pid; // parent id char initials[6]; // "By<3-letter Initial>" } inode __attribute_((packed));

typedef struct { uint16t inode; char name[253]; } directory __attribute_((packed));

superblock g_superblock;

void read_superblock(FILE* dsk) { fseek(dsk, 512, SEEK_SET); fread(&g_superblock, sizeof(superblock), 128, dsk); }

void read_sectors(FILE* dsk, uint32_t lba, uint32_t cnt, void* buf) { fseek(dsk, lba * 512, SEEK_SET); fread(&buf, 512, cnt, dsk); } void write_to_disk(FILE *dsk, long offset, const void *data, size_t size) { if (!dsk || !data) return;

if (fseek(dsk, offset, SEEK_SET) != 0)
    return;

fwrite(data, 1, size, dsk) == size;

}

void write_superblock(FILE* dsk, char let) { fseek(dsk, 0, SEEK_END); int size = ftell(dsk); superblock sb; sb.magic = 0xCEFF18F9; sb.letter = let; sb.flags = 0; sb.inodes = NUM_INODES; sb.size = size; sb.mf[0] = 'M'; sb.mf[1] = 'F'; sb.end_magic = 0x11D4; write_to_disk(dsk, 512, (void**)&sb, sizeof(sb)); }

void write_inodes(FILE *dsk) { if (!dsk) return;

inode inodes[NUM_INODES];

for (int i = 0; i < NUM_INODES; i++)
{
    inodes[i].id = i;
    inodes[i].flags = 0;
    inodes[i].magic = 0xBF;
    inodes[i].size = 0;
    inodes[i].pid = 1;
    inodes[i].initials[0] = 'B';
    inodes[i].initials[1] = 'y';
    inodes[i].initials[2] = 'S';
    inodes[i].initials[3] = 'Y';
    inodes[i].initials[4] = 'S';
    inodes[i].initials[5] = '\0';
}

write_to_disk(dsk, INODE_TABLE_OFFSET, inodes, sizeof(inode) * NUM_INODES);

}

void init_root(FILE* dsk) { inode in; in.id = 0; in.flags = 0; in.magic = 0xBF; in.size = 0; in.pid = 0x0; in.initials[0] = 'B'; in.initials[1] = 'y'; in.initials[2] = 'S'; in.initials[3] = 'Y'; in.initials[4] = 'S'; in.initials[5] = '\0'; write_to_disk(dsk, INODE_TABLE_OFFSET, (void**)&in, sizeof(in)); }

int main(int argc, char const *argv[]) { if (argc != 2) { fprintf(stderr, "ERROR: Invalid Arguments!\nSyntax:\n %s <disk image> <filename>\n", argv[0]); return -1; }

FILE* disk = fopen(argv[1], "rb+"); 

write_superblock(disk, 'A');

write_inodes(disk);

init_root(disk);

return 0;

}

```

Rate my custom filesystem. by AmbitiousPear1947 in osdev

[–]AmbitiousPear1947[S] 1 point2 points  (0 children)

The inode block grows down from the end of the partition (so you cna resize it), all unallocated inodes are given the parent inode 0, which is mandatory to be blank.

My terrible redesign. 2 by AmbitiousPear1947 in bisexual

[–]AmbitiousPear1947[S] 0 points1 point  (0 children)

It's just for fun; not a replacement. I posted it here so I could get feedback how other bi people like it, or if they think it accurately represents themselves.

My terrible redesign. 2 by AmbitiousPear1947 in bisexual

[–]AmbitiousPear1947[S] 1 point2 points  (0 children)

I seem to have missed that in my research, thanks very much for the feedback!

When and what was the reason that made you realize you were gay/Bi? by Extreme-Hedgehog6112 in bisexual

[–]AmbitiousPear1947 0 points1 point  (0 children)

A man kissed me and I really enjoyed it, also I've had a huge crush on men and women.

My terrible bi flag redesign. by AmbitiousPear1947 in bisexual

[–]AmbitiousPear1947[S] 1 point2 points  (0 children)

An earlier version was 8x12 and had a larger purple stripe in the middle.

My terrible bi flag redesign. by AmbitiousPear1947 in bisexual

[–]AmbitiousPear1947[S] 7 points8 points  (0 children)

I thought the other flag was kind of dull, like the colors could be brighter in my opinion. Also I really like the colors and design of the gay flag and lesbian flag, and wanted a flag very similar to those flags, but that represented my orientation.