-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain concept.txt
65 lines (48 loc) · 7.7 KB
/
Main concept.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
MPFS-53 is a 53 bit file system. The unusual number of bits is due to the fact that in mindustry it is normal to work with bits from 0 to 52.
Main - Controls all logic of the file system. To edit and read data it accesses controller. Main does not need to think about how data is written.
Controller - Receives commands from Main. It tells the bus what commands to pass to which sub controller. And informs the bus that it needs to read something.
data bus - Data bus. It is basically n number of processors. Each processor has its own id. The processor with 0 id distributes the duties between the processors in the bus.
Thus you get a multi-core data transfer.
sub controller - Processor that controls the “data cluster”.
command bufer - An element that saves data into a buffer. It consists of n number of processors and memory blocks. Each processor has its own id. A processor with 0 id distributes duties among processors.
core - Can be any number of processors. Can read and write data. Converts numbers to floating point numbers and back. Executes sub controller commands
Translated with DeepL.com (free version)
In MPFS-53 there is no way to enter the full path to a file and go directly to it. This is because mindustry has a relatively small memory block size. As a result,
you cannot use long folder names or have a large file system depth. There is another reason why this will not happen. You have to read data from the port every time.
And compare it to the path that MPFS-53 is currently on. If you consider the speed of the processors in mindustry. This action will successfully reduce the speed of the operation.
The solution to this problem is to capture objects or "Ping". The idea is that we slowly navigate through the catalogs to the objects we need. Then we capture them.
That is, MPFS-53 writes to the cache:
The bit that starts the table of the directory in which the object we want is located.
The bit that starts the mention of the object in the catalog.
The number of the memory fragment in which the object starts.
The cache has a static size. It is determined during file system initialization. Based on the maximum number of captured objects. This is specified by the user.
There are 2 ports between mpfs-53 and the user.
1 (talk in variables) is for communication with the user. Commands, errors, names, etc. are sent there.
2 (buffer in variables) for data exchange. Main does not look at them at all. If the Allocator detects a sector outlier.
Allocator informs Main about it. Main then looks for a free sector.
In mpfs-53 there is a division into sectors and clusters. Clusters are made up of sectors. The division into clusters is physical. It is done so that mpfs can be larger.
1 sector cannot be in 2 sectors at the same time. All sectors must be the same size. So there are situations when a cluster will not be used because of the size of a sector
MPFS-53 это 53 битная файловая система. Необычное количество битов обусловленно тем что в mindustry нормальная работа с битами от 0 до 52.
Main - Управляет всей логикой файловой системы. Для редактирования и чтения данных обращается к controller. Main не нужно задумоватся как именно пишутся данные.
controller - Принимает команды от Main. Он сообщает шине об том какие команды передать к каким sub controller. И сообщает шине то что нужно что-то прочесть
data bus - Шина данных. По сути это n количество процессоров. У каждого процессора есть свой id. Процессор с 0 id распределяет обязаности между процессорами в шине.
Тем самым получается много ядерная передача данных.
sub controller - Процессор управляющий "кластером данных".
command bufer - Элемент сохраняющий данные в буфер. Он состоит из n количества процессоров и блоков памяти. У каждого процессора есть свой id. Процессор с 0 id распределяет обязаности между процессорами.
core - Может быть сколько угодно. Может читать и записывать данные. Переводит числа в числа с плавающей запятой и обратно. Выполняет команды sub controller
В MPFS-53 нет способа введя полный путь к файлу сразу перейти к нему. Это обусловленно тем что в mindustry относительн маленький объём блоков памяти.
В результате чего нельзя использовать длинные имена папок или иметь большую глубину файловой системы. Есть ещё одна причина по которой этого не будет.
Нужно будет каждый раз читать данные из порта. И сравнивать их с путём в котором сейчас находится MPFS-53. Если учесть скорость работы процессоров в mindustry.
Это действие будет успешно урезать скорость работы.
Решением этой проблемы является захват объектов или "Ping". Суть в том что мы медленно по одной команде переходим по каталогам до нужных нам объектов. Затем мы захватываем их.
То есть MPFS-53 записывает в кэш:
Бит с которого начинается таблица каталога, в котором находится нужный нам объект.
Бит с которого начинается упомянание объекта в каталоге.
Номер фрагмента памяти в котором начинается объект.
Кэш имеет статичный размер. Он определяется при инициализации файловой системы. Исходя из максимального количества захваченых объектов. Это указывается пользвателем.
Между mpfs-53 и пользователем есть 2 порта.
1 (talk в переменных) для общения с пользователем. Туда передаются команды, ошибки, имена и т.д.
2 (buffer в переменных) для обмена данными. Main вообще не смотрит на них. Если Allocator обнаружил выход за сектор. Allocator сообщает об этом Main. После чего Main ищет свободный сектор.
В mpfs-53 есть деление на сектора и кластеры.
Кластеры состоят из секторов. Деление на кластеры физическое. Оно сделано для того чтобы mpfs мог быть больше.
1 сектор не может находится в 2 секторах одновременно. Все сектора должны быть одинакового размера. То есть есть ситуации когда кластер будет использован не пользован из-за размера сектора