Write a Move command that will copy the last 32 bytes of the Code segment to location 1000 in the Data segment - microprocessors

Write a Move command that will copy the last 32 bytes of the Code segment to
location 1000 in the Data segment.
What is the minimum and maximum number of bytes that can be moved using the
Move command?

Related

Why do file systems limit maximum length of a file name?

Most posts i read just give info about the maximum file name length's. But, i want to understand why there's this limit. Why can't file name's be big. I see that few file systems have put a limit of 255 bytes. Why not 1 MB or anything more than 255 bytes. I probably would never have a file name of length more than 100 characters. But, this question is about why the limit?
long file name costs much more space and time than you can imagine
the 255 bytes limit of file name length is a long time trade off between human
onvenience and space/time efficiency
and backward compatibility , of course
back to the dark old days , the capacity of hard drive capacity was count by MB or a few GB
file name are often stored in some fixed length C structs ,
and the size of the struct was mostly round by the factor of 512 byte,
which is the size of a physical sector ,so that it can be read out by a single touch of the head
if the file system put a limit of 1MB on filename, it would run out of harddisk space with only a few hundred files. and memory limits also applys.....

Using Spark dataframe how to control output file size when saving text or json to S3

I need to a way to control the output file size when saving txt/json to S3 using java/scala.
e.g. I would like a rolling file size of 10 mb,
how can i control this using dataframe code,
I have experimented with spark.sql.files.maxPartitionBytes.
This does not give accurate control.
e.g if I set spark.sql.files.maxPartitionBytes=32MB
The output files are of size 33 mb.
Other option is to use reparition, df.rdd.reparition(n)
this will create n files.
The values of n = size of inputfile/roll file size
e.g input file size=200 mb, roll size=32 mb,
n = 200/32 = 7. Creates 6 files of size 32mb and 1 one 8 mb file.
Appreciate any thoughts about controlling the output file size.
Thanks

Segment raw time series into chunks

I have written code in Matlab to read data from CSV file and store it in an array the file contain many rows and 4 main columns (time, x,y,z). the time is then divided into segments of 10 seconds. i have calculated the start and finish time for each segment, now I want to get the x,y,and z-data into each segment. can you guys help me please?

FAT12 - reading first cluster number of file from root directory

In the root directory of FAT12, bytes 26-27 represent the number of the first cluster of the file. However, cluster numbers in FAT12 are 12 bits long. So what part of that 2 byte entry in the root directory contains the actual 12 bit cluster number ? Is there any conversion that needs to be performed on reading those 2 bytes to get the cluster ? I have looked around over the Internet, but cant find a proper explanation for this.
The lowest 12 bits, i.e. you do an & 0x0FFF in your code. But on the other hand, the full 16 bits are used – the other 4 bits are just filled with 0, so the number is a valid word (16-bit integer).

What is the largest file size one can store on a disk that uses inodes and disk blocks

I have a question here that I do not know how to calculate the maximal size of a file that one can store on a disk that uses inodes and disk blocks.
Assuming a page size of 4096 bytes, a page table entry that points to a frame takes 8 bytes (4
bytes for the pointer plus some flags), and a page table entry that points to another page table
takes 4 bytes, how many levels of page tables would be required to map a 32-bit address space if
each level page table must fit into a single page?
What the maximal file size one can store on a disk that uses inodes and disk blocks that store 4096 bytes. Each inode can store 10 entries, and the first inode reserves the last two entries for cascading inode???
For the first part of the question, I got the total number of levels is 3, but I do not know how to do the second part.
What you're describing sounds like the EXT filesystem.
EXT3 uses a total of 15 pointers.
The first 12 entries are direct: they point directly to data blocks. The third to final entry is a level 1 indirect: it points to a block filled entirely with level 1 entries. The second to final entry is a level 2 indirect: it points to a block completely full of level 1 indirects. The last entry is a level 3 indirect.
The maximum file size on this system is usually a restriction of the operating system, and is usually between 16GB and 2TB.
The theoretical maximum is 12I + I^2/P + I^3/P^2 + I^4/P^3, where I is the inode size in bytes (typically 4096, though different values are possible), and P is the pointer size, in bytes (4). This yields a maximum theoretical size of 4,402,345,721,856 bytes.
EXT3 Inode pointer structure