In this piece of code, the routine get_block(b, i) reads block number i from disk and puts it into buffer b.
unsigned char get_byte(int offset, int file[16]) { char buf[BLOCKSIZE]; int *ip; int bn, bo, i1bn, i1bo, i2bn, i2bo, ibs; if (offset > file[0]) { flag error } bn = offset / BLOCKSIZE; bo = offset % BLOCKSIZE; ibs = BLOCKSIZE/sizeof(int); if (bn < 13) { get_block(buf, file[bn+1]); return buf[bo]; } get_block(buf,file[14]); ip = (int *) buf; for (i = 0; i < ibs; i += 2) { if (ip[i] == bn) { get_block(buf, ip[i+1]); return buf[bo]; } } bn -= 13; ib1n = bn / ibs; ib1o = bn % ibs; ib2n = ib1n / ibs; ib2o = ib1n % ibs; get_block(buf, file[15]); get_block(buf, buf[ib2n]); get_block(buf, buf[ib2o]); get_block(buf, buf[ib1o]); return buf[bo]; }Part 1: Explain exactly how files are organized. Give some motivational reasons why files would be organized in this way, and what extra code needs to be in the operating system in order for this to work well.
Part 2: Suppose my block size is 128 bytes, and integers are 4 bytes. What is the maximum file size under this scheme? You can just give me math here, and not a real number, although I would like your math to be a clean expression.