Skip to content

Commit 6663559

Browse files
authored
Merge pull request #75 from Tearth/develop
Develop
2 parents e4ab9df + f4fed14 commit 6663559

File tree

122 files changed

+4933
-2436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+4933
-2436
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ tools
5757
build
5858
scripts
5959
.vscode
60+
docs
6061

6162
cloc.exe
6263
cloc.bat

Diff for: .travis.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: c
2+
dist: bionic
3+
sudo: true
4+
before_install:
5+
- sudo apt-get update && sudo apt install -y nasm mtools curl build-essential libmpfr6 libfl2 doxygen
6+
script:
7+
- source ./travis_scripts/download_dependecies.sh
8+
- ./configure.sh -w $TRAVIS_BUILD_DIR -t 1
9+
- ls
10+
- ./scripts/build.sh
11+
- doxygen Doxyfile
12+
deploy:
13+
- provider: pages
14+
skip_cleanup: true
15+
local_dir: docs/html
16+
github_token: $GH_REPO_TOKEN
17+
on:
18+
branch: develop
19+
- provider: releases
20+
skip_cleanup: true
21+
api_key: $GH_REPO_TOKEN
22+
file_glob: true
23+
file:
24+
- "build/floppy.img"
25+
on:
26+
tags: true
27+
branch: master

Diff for: Doxyfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PROJECT_LOGO =
5858
# entered, it will be relative to the location where doxygen was started. If
5959
# left blank the current directory will be used.
6060

61-
OUTPUT_DIRECTORY = C:\Users\Pawel\Desktop\GitHub\MicrOS\docs
61+
OUTPUT_DIRECTORY = ./docs
6262

6363
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
6464
# directories (in 2 levels) under the output directory of each output format and
@@ -813,7 +813,7 @@ WARN_LOGFILE =
813813
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
814814
# Note: If this tag is empty the current directory is searched.
815815

816-
INPUT = C:\Users\Pawel\Desktop\GitHub\MicrOS
816+
INPUT = .
817817

818818
# This tag can be used to specify the character encoding of the source files
819819
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

Diff for: README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
# MicrOS
1+
![Logo](https://i.imgur.com/lNuuSvc.png)
22

3-
This is the simple 32-bit operating system developed by the SKNI KOD (Studenckie Koło Naukowe Informatyków KOD). Our main goal is to create the OS which will have functionality similar to the famous MS-DOS and be able to run on every modern computer.
3+
<p align="center">
4+
<a href="https://travis-ci.org/Tearth/MicrOS"><img src="https://travis-ci.org/Tearth/MicrOS.svg?branch=develop" alt="Build status"></img></a>
5+
<a href="https://github.com/Tearth/MicrOS/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed-raw/Tearth/MicrOS" alt="Closed pull requests"></img></a>
6+
<a href="https://github.com/Tearth/MicrOS/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Tearth/MicrOS" alt="License"></img></a>
7+
<a href="https://tearth.github.io/MicrOS/"><img src="https://img.shields.io/badge/Doxygen-gh--pages-blue" alt="Documentation"></img></a>
8+
</p>
49

5-
The repository doesn't contain all files necessary to successful compilation - we use our internal build scripts which aren't present here. We will release complete image files when the OS will be ready for basic usage. Feel free to analyze and use any part of this project (but remember about GPL-3 license restrictions).
10+
This is the simple 32-bit operating system developed by the SKNI KOD (Studenckie Koło Naukowe Informatyków KOD). Our main goal is to create the OS which will have functionality similar to the famous MS-DOS and be able to run on every modern computer. Feel free to analyze and use any part of this project (but remember about GPL-3 license restrictions).
11+
12+
Full description about how to build MicrOS (on Linux or Windows 10 WSL) can be read here: https://github.com/jaenek/MicrOS-DevTools.
13+
14+
Documentation: https://tearth.github.io/MicrOS/
615

716
## What is done
817
* Bootloader which loads the kernel by looking for a file in a FAT12 filesystem and enters the protected mode
@@ -13,21 +22,24 @@ The repository doesn't contain all files necessary to successful compilation - w
1322
* PC Speaker
1423
* RTC (Real-Time Clock)
1524
* PIT (Programmable Interval Timer)
25+
* ATA
1626
* Interrupts (software, hardware, exceptions) manager
1727
* Paging
1828
* Physical/Virtual memory manager
1929
* Heap
20-
* FAT12 filesystem - read and write
30+
* FAT12/16 filesystem - read and write
31+
* Partitions
2132
* PCI (Peripheral Component Interconnect) - partially
2233
* Panic screen
2334
* User space
2435
* ELF executing
2536
* Multitasking (with primitive round-rubin scheduler)
2637
* Simple shell and basic applications
2738
* Standard library for C
39+
* ATA Hard disk drive support
2840

2941
## TODO
30-
* Hard disk drive support
42+
* Other standards of hard disk drive support
3143
* More advanced scheduler with priorities and IO blocking
3244
* Support for network cards (and protocols related to them)
3345
* ...

Diff for: docs/.gitkeep

Whitespace-only changes.

Diff for: environment/cat/makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)
1313

1414
DEPS := $(C_OBJECTS:.o=.d)
1515

16-
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter
17-
GCC_LINK_FLAGS := -L../../Library/bin -lc -lgcc -nostdlib
16+
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter -Wno-packed-bitfield-compat
17+
GCC_LINK_FLAGS := -L../../library/bin -lc -lgcc -nostdlib
1818

1919
ifeq ($(MODE),release)
2020
GCC_COMPILE_FLAGS += -O2

Diff for: environment/cat/src/main.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ int main(int argc, char *argv[])
1515

1616
char *current_dir = argv[1];
1717
char *path = argv[2];
18+
char current_partition_symbol = current_dir[0];
1819

19-
char path_variations[2][64];
20-
sprintf(path_variations[0], "%s", path);
21-
sprintf(path_variations[1], "%s/%s", current_dir, path);
20+
char path_variations[3][64];
21+
sprintf(path_variations[0], "%s", path); // A:/ENV
22+
sprintf(path_variations[1], "%c:/%s", current_partition_symbol, path); // /ENV -> A:/ENV
23+
sprintf(path_variations[2], "%s/%s", current_dir, path); // DATA -> A:/ENV/DATA
2224

23-
for (int i = 0; i < 2; i++)
25+
for (int i = 0; i < 3; i++)
2426
{
2527
reduce_slashes(path_variations[i]);
2628
if(micros_filesystem_file_exists(path_variations[i]))

Diff for: environment/help/makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)
1313

1414
DEPS := $(C_OBJECTS:.o=.d)
1515

16-
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter
17-
GCC_LINK_FLAGS := -L../../Library/bin -lc -lgcc -nostdlib
16+
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter -Wno-packed-bitfield-compat
17+
GCC_LINK_FLAGS := -L../../library/bin -lc -lgcc -nostdlib
1818

1919
ifeq ($(MODE),release)
2020
GCC_COMPILE_FLAGS += -O2

Diff for: environment/help/src/main.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
#include <micros.h>
22
#include <stdio.h>
33

4+
char help_path_with_partition[64];
45
const char help_path[] = "/DATA/HELP.TXT";
56

67
int main(int argc, char *argv[])
78
{
89
micros_process_set_current_process_name("HELP");
9-
if(!micros_filesystem_file_exists((char *)help_path))
10+
11+
sprintf(help_path_with_partition, "%c:%s", argv[1][0], help_path);
12+
if(!micros_filesystem_file_exists((char *)help_path_with_partition))
1013
{
1114
printf("No HELP.TXT file\n");
1215
return -1;
1316
}
1417

1518
micros_filesystem_file_info info;
16-
micros_filesystem_get_file_info((char *)help_path, &info);
19+
micros_filesystem_get_file_info((char *)help_path_with_partition, &info);
1720

1821
uint8_t *buffer = malloc(sizeof(char) * info.size);
19-
micros_filesystem_read_file(help_path, buffer, 0, info.size);
20-
22+
micros_filesystem_read_file((char *)help_path_with_partition, buffer, 0, info.size);
23+
2124
for(uint32_t i = 0; i < info.size; i++)
2225
{
2326
if(buffer[i] == '\r')
2427
{
2528
continue;
2629
}
2730

28-
micros_console_print_char((char *)buffer[i]);
31+
micros_console_print_char((char)buffer[i]);
2932
}
3033
micros_console_print_char('\n');
3134

Diff for: environment/ls/makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)
1313

1414
DEPS := $(C_OBJECTS:.o=.d)
1515

16-
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter
17-
GCC_LINK_FLAGS := -L../../Library/bin -lc -lgcc -nostdlib
16+
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter -Wno-packed-bitfield-compat
17+
GCC_LINK_FLAGS := -L../../library/bin -lc -lgcc -nostdlib
1818

1919
ifeq ($(MODE),release)
2020
GCC_COMPILE_FLAGS += -O2

Diff for: environment/ls/src/main.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ int main(int argc, char *argv[])
99
micros_process_set_current_process_name("LS");
1010
char *path = argc >= 4 ? argv[2] : argv[1];
1111
char *current_dir = argv[1];
12+
char current_partition_symbol = current_dir[0];
1213

13-
char path_variations[2][64];
14-
sprintf(path_variations[0], "%s", path);
15-
sprintf(path_variations[1], "%s/%s", current_dir, path);
14+
char path_variations[3][64];
15+
sprintf(path_variations[0], "%s", path); // A:/ENV
16+
sprintf(path_variations[1], "%c:/%s", current_partition_symbol, path); // /ENV -> A:/ENV
17+
sprintf(path_variations[2], "%s/%s", current_dir, path); // DATA -> A:/ENV/DATA
1618

17-
for (int i = 0; i < 2; i++)
19+
for (int i = 0; i < 3; i++)
1820
{
1921
reduce_slashes(path_variations[i]);
20-
if((path_variations[i][0] == '/' && path_variations[i][1] == 0) || micros_filesystem_directory_exists(path_variations[i]))
22+
if((path_variations[i][2] == '/' && path_variations[i][3] == 0) || micros_filesystem_directory_exists(path_variations[i]))
2123
{
2224
int count = micros_filesystem_get_entries_count_in_directory(path_variations[i]);
2325
char **entries = malloc(sizeof(char *) * count);

Diff for: environment/mkdir/makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ASM_OBJECTS := $(patsubst $(SRC_DIR)/%.asm,$(OBJ_DIR)/%.o,$(ASM_SOUCES))
1313

1414
DEPS := $(C_OBJECTS:.o=.d)
1515

16-
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter
17-
GCC_LINK_FLAGS := -L../../Library/bin -lc -lgcc -nostdlib
16+
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter -Wno-packed-bitfield-compat
17+
GCC_LINK_FLAGS := -L../../library/bin -lc -lgcc -nostdlib
1818

1919
ifeq ($(MODE),release)
2020
GCC_COMPILE_FLAGS += -O2

Diff for: environment/rename/makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)
1313

1414
DEPS := $(C_OBJECTS:.o=.d)
1515

16-
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter
17-
GCC_LINK_FLAGS := -L../../Library/bin -lc -lgcc -nostdlib
16+
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter -Wno-packed-bitfield-compat
17+
GCC_LINK_FLAGS := -L../../library/bin -lc -lgcc -nostdlib
1818

1919
ifeq ($(MODE),release)
2020
GCC_COMPILE_FLAGS += -O2

Diff for: environment/rename/src/main.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ int main(int argc, char *argv[])
1515
char *current_dir = argv[1];
1616
char *path = argv[2];
1717
char *new_name = argv[3];
18+
char current_partition_symbol = current_dir[0];
1819

1920
if(strlen(new_name) > 12)
2021
{
2122
printf("Name too long\n");
2223
return -1;
2324
}
2425

25-
char path_variations[2][64];
26-
sprintf(path_variations[0], "%s", path);
27-
sprintf(path_variations[1], "%s/%s", current_dir, path);
26+
char path_variations[3][64];
27+
sprintf(path_variations[0], "%s", path); // A:/ENV
28+
sprintf(path_variations[1], "%c:/%s", current_partition_symbol, path); // /ENV -> A:/ENV
29+
sprintf(path_variations[2], "%s/%s", current_dir, path); // DATA -> A:/ENV/DATA
2830

29-
for (int i = 0; i < 2; i++)
31+
for (int i = 0; i < 3; i++)
3032
{
3133
reduce_slashes(path_variations[i]);
3234
if(micros_filesystem_file_exists(path_variations[i]))

Diff for: environment/rm/makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ ASM_OBJECTS := $(patsubst $(SRC_DIR)/%.asm,$(OBJ_DIR)/%.o,$(ASM_SOUCES))
1313

1414
DEPS := $(C_OBJECTS:.o=.d)
1515

16-
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter
17-
GCC_LINK_FLAGS := -L../../Library/bin -lc -lgcc -nostdlib
16+
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter -Wno-packed-bitfield-compat
17+
GCC_LINK_FLAGS := -L../../library/bin -lc -lgcc -nostdlib
1818

19-
ifneq ($(MODE),release)
19+
ifeq ($(MODE),release)
2020
GCC_COMPILE_FLAGS += -O2
2121
GCC_LINK_FLAGS += -s -DNDEBUG
2222
else

Diff for: environment/rm/src/main.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ int main(int argc, char *argv[])
1414

1515
char *current_dir = argv[1];
1616
char *path = argv[2];
17+
char current_partition_symbol = current_dir[0];
1718

18-
char path_variations[2][64];
19-
sprintf(path_variations[0], "%s", path);
20-
sprintf(path_variations[1], "%s/%s", current_dir, path);
21-
22-
for (int i = 0; i < 2; i++)
19+
char path_variations[3][64];
20+
sprintf(path_variations[0], "%s", path); // A:/ENV
21+
sprintf(path_variations[1], "%c:/%s", current_partition_symbol, path); // /ENV -> A:/ENV
22+
sprintf(path_variations[2], "%s/%s", current_dir, path); // DATA -> A:/ENV/DATA
23+
24+
for (int i = 0; i < 3; i++)
2325
{
2426
reduce_slashes(path_variations[i]);
2527
if(micros_filesystem_file_exists(path_variations[i]))

Diff for: environment/shell/makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)
1313

1414
DEPS := $(C_OBJECTS:.o=.d)
1515

16-
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter
17-
GCC_LINK_FLAGS := -L../../Library/bin -lc -lgcc -nostdlib
16+
GCC_COMPILE_FLAGS := -I../../library/src -ffreestanding -Wall -Wextra -Wno-unused-parameter -Wno-packed-bitfield-compat
17+
GCC_LINK_FLAGS := -L../../library/bin -lc -lgcc -nostdlib
1818

1919
ifeq ($(MODE),release)
2020
GCC_COMPILE_FLAGS += -O2

0 commit comments

Comments
 (0)