Skip to content

Commit

Permalink
Добавление инструкций по сборке и запуску
Browse files Browse the repository at this point in the history
  • Loading branch information
Aren committed Oct 21, 2023
1 parent 976513b commit 94dca21
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 9 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,35 @@

- ООО "НПО ТЕ-ОН"

## Сборка из исходного кода

### Ubuntu 18+

```bash
sudo apt install clang-format python3 git qemu-system-x86
git clone https://git.synapseos.ru/Aren/BMOSP.git
cd BMOSP/
chmod +x build.sh
./build.sh
```

## Запук

### Qemu

Стандартная конфигурация

```bash
qemu-system-x86_64 -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -name "БМПОС"
```

Или

```bash
chmod +x run.sh
./run.sh
```

## Предупреждение

Использовать на свой страх и риск. Система расчитана на работу в эмулируемой среде Qemu под процессоры x86_64.
Expand Down
4 changes: 3 additions & 1 deletion include/lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ typedef struct {
} lock_t;

#define LOCK_INIT \
(lock_t) { 0, __FILE__ }
(lock_t) { \
0, __FILE__ \
}

namespace lock {
int swap(lock_t* lock);
Expand Down
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 1
#define VERSION_BUILD 227
#define VERSION_BUILD 231
8 changes: 4 additions & 4 deletions kernel/mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ static volatile struct limine_module_request module_request = {
};

struct limine_module_response *module_response;
static uint64_t module_count = 0;
static uint64_t modules_count = 0;

void init( ) {
main_env.fb_printf = &fb::printf;
module_response = module_request.response;
module_count = module_response->module_count;
uint64_t module_count = module_response->module_count;
struct limine_file *module_ptr = (struct limine_file *)0;

for (uint64_t i = 0; i < module_count; i++) {
Expand All @@ -94,11 +94,10 @@ void init( ) {
fb::printf("\t\t[BOOTIMG]\n");
bootpng_ptr = module_ptr->address;
bootpng_size = module_ptr->size;
main( );
continue;
}
if (!tool::starts_with(module_ptr->cmdline, "[MOD]")) { continue; }

modules_count++;
module_info_t *(*module_init)(env_t * env) =
(module_info_t * (*)(env_t * env))
elf_entry(module_ptr->address, module_ptr->size);
Expand All @@ -110,5 +109,6 @@ void init( ) {
// fb::printf("Инициализированно с кодом: %u\n", ret->err_code);
// fb::printf("Сообщение из модуля: %s\n\n", ret->message);
}
fb::printf("Модулей обработано: %u\n", modules_count);
}
} // namespace mod
7 changes: 4 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
#qemu-system-x86_64 -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot
#qemu-system-x86_64 -cpu host -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd
qemu-system-x86_64 -enable-kvm -cpu host -m 6G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot
qemu-system-x86_64 -name "БМПОС" -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd --no-reboot
#qemu-system-x86_64 -name "БМПОС" -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot
#qemu-system-x86_64 -name "БМПОС" -cpu host -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd
#qemu-system-x86_64 -name "БМПОС" -enable-kvm -cpu host -m 6G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot

0 comments on commit 94dca21

Please sign in to comment.