Skip to content

Commit

Permalink
Merge pull request #75 from Tearth/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Tearth authored Dec 9, 2019
2 parents e4ab9df + f4fed14 commit 6663559
Show file tree
Hide file tree
Showing 122 changed files with 4,933 additions and 2,436 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ tools
build
scripts
.vscode
docs

cloc.exe
cloc.bat
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: c
dist: bionic
sudo: true
before_install:
- sudo apt-get update && sudo apt install -y nasm mtools curl build-essential libmpfr6 libfl2 doxygen
script:
- source ./travis_scripts/download_dependecies.sh
- ./configure.sh -w $TRAVIS_BUILD_DIR -t 1
- ls
- ./scripts/build.sh
- doxygen Doxyfile
deploy:
- provider: pages
skip_cleanup: true
local_dir: docs/html
github_token: $GH_REPO_TOKEN
on:
branch: develop
- provider: releases
skip_cleanup: true
api_key: $GH_REPO_TOKEN
file_glob: true
file:
- "build/floppy.img"
on:
tags: true
branch: master
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = C:\Users\Pawel\Desktop\GitHub\MicrOS\docs
OUTPUT_DIRECTORY = ./docs

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

INPUT = C:\Users\Pawel\Desktop\GitHub\MicrOS
INPUT = .

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# MicrOS
![Logo](https://i.imgur.com/lNuuSvc.png)

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.
<p align="center">
<a href="https://travis-ci.org/Tearth/MicrOS"><img src="https://travis-ci.org/Tearth/MicrOS.svg?branch=develop" alt="Build status"></img></a>
<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>
<a href="https://github.com/Tearth/MicrOS/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Tearth/MicrOS" alt="License"></img></a>
<a href="https://tearth.github.io/MicrOS/"><img src="https://img.shields.io/badge/Doxygen-gh--pages-blue" alt="Documentation"></img></a>
</p>

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).
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).

Full description about how to build MicrOS (on Linux or Windows 10 WSL) can be read here: https://github.com/jaenek/MicrOS-DevTools.

Documentation: https://tearth.github.io/MicrOS/

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

## TODO
* Hard disk drive support
* Other standards of hard disk drive support
* More advanced scheduler with priorities and IO blocking
* Support for network cards (and protocols related to them)
* ...
Expand Down
Empty file removed docs/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions environment/cat/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)

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

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

ifeq ($(MODE),release)
GCC_COMPILE_FLAGS += -O2
Expand Down
10 changes: 6 additions & 4 deletions environment/cat/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ int main(int argc, char *argv[])

char *current_dir = argv[1];
char *path = argv[2];
char current_partition_symbol = current_dir[0];

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

for (int i = 0; i < 2; i++)
for (int i = 0; i < 3; i++)
{
reduce_slashes(path_variations[i]);
if(micros_filesystem_file_exists(path_variations[i]))
Expand Down
4 changes: 2 additions & 2 deletions environment/help/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)

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

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

ifeq ($(MODE),release)
GCC_COMPILE_FLAGS += -O2
Expand Down
13 changes: 8 additions & 5 deletions environment/help/src/main.c
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
#include <micros.h>
#include <stdio.h>

char help_path_with_partition[64];
const char help_path[] = "/DATA/HELP.TXT";

int main(int argc, char *argv[])
{
micros_process_set_current_process_name("HELP");
if(!micros_filesystem_file_exists((char *)help_path))

sprintf(help_path_with_partition, "%c:%s", argv[1][0], help_path);
if(!micros_filesystem_file_exists((char *)help_path_with_partition))
{
printf("No HELP.TXT file\n");
return -1;
}

micros_filesystem_file_info info;
micros_filesystem_get_file_info((char *)help_path, &info);
micros_filesystem_get_file_info((char *)help_path_with_partition, &info);

uint8_t *buffer = malloc(sizeof(char) * info.size);
micros_filesystem_read_file(help_path, buffer, 0, info.size);

micros_filesystem_read_file((char *)help_path_with_partition, buffer, 0, info.size);
for(uint32_t i = 0; i < info.size; i++)
{
if(buffer[i] == '\r')
{
continue;
}

micros_console_print_char((char *)buffer[i]);
micros_console_print_char((char)buffer[i]);
}
micros_console_print_char('\n');

Expand Down
4 changes: 2 additions & 2 deletions environment/ls/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)

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

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

ifeq ($(MODE),release)
GCC_COMPILE_FLAGS += -O2
Expand Down
12 changes: 7 additions & 5 deletions environment/ls/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ int main(int argc, char *argv[])
micros_process_set_current_process_name("LS");
char *path = argc >= 4 ? argv[2] : argv[1];
char *current_dir = argv[1];
char current_partition_symbol = current_dir[0];

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

for (int i = 0; i < 2; i++)
for (int i = 0; i < 3; i++)
{
reduce_slashes(path_variations[i]);
if((path_variations[i][0] == '/' && path_variations[i][1] == 0) || micros_filesystem_directory_exists(path_variations[i]))
if((path_variations[i][2] == '/' && path_variations[i][3] == 0) || micros_filesystem_directory_exists(path_variations[i]))
{
int count = micros_filesystem_get_entries_count_in_directory(path_variations[i]);
char **entries = malloc(sizeof(char *) * count);
Expand Down
4 changes: 2 additions & 2 deletions environment/mkdir/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ASM_OBJECTS := $(patsubst $(SRC_DIR)/%.asm,$(OBJ_DIR)/%.o,$(ASM_SOUCES))

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

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

ifeq ($(MODE),release)
GCC_COMPILE_FLAGS += -O2
Expand Down
4 changes: 2 additions & 2 deletions environment/rename/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)

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

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

ifeq ($(MODE),release)
GCC_COMPILE_FLAGS += -O2
Expand Down
10 changes: 6 additions & 4 deletions environment/rename/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ int main(int argc, char *argv[])
char *current_dir = argv[1];
char *path = argv[2];
char *new_name = argv[3];
char current_partition_symbol = current_dir[0];

if(strlen(new_name) > 12)
{
printf("Name too long\n");
return -1;
}

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

for (int i = 0; i < 2; i++)
for (int i = 0; i < 3; i++)
{
reduce_slashes(path_variations[i]);
if(micros_filesystem_file_exists(path_variations[i]))
Expand Down
6 changes: 3 additions & 3 deletions environment/rm/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ ASM_OBJECTS := $(patsubst $(SRC_DIR)/%.asm,$(OBJ_DIR)/%.o,$(ASM_SOUCES))

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

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

ifneq ($(MODE),release)
ifeq ($(MODE),release)
GCC_COMPILE_FLAGS += -O2
GCC_LINK_FLAGS += -s -DNDEBUG
else
Expand Down
12 changes: 7 additions & 5 deletions environment/rm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ int main(int argc, char *argv[])

char *current_dir = argv[1];
char *path = argv[2];
char current_partition_symbol = current_dir[0];

char path_variations[2][64];
sprintf(path_variations[0], "%s", path);
sprintf(path_variations[1], "%s/%s", current_dir, path);

for (int i = 0; i < 2; i++)
char path_variations[3][64];
sprintf(path_variations[0], "%s", path); // A:/ENV
sprintf(path_variations[1], "%c:/%s", current_partition_symbol, path); // /ENV -> A:/ENV
sprintf(path_variations[2], "%s/%s", current_dir, path); // DATA -> A:/ENV/DATA

for (int i = 0; i < 3; i++)
{
reduce_slashes(path_variations[i]);
if(micros_filesystem_file_exists(path_variations[i]))
Expand Down
4 changes: 2 additions & 2 deletions environment/shell/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ASM_OBJECTS := $(ASM_SOUCES:%.asm=$(OBJ_DIR)/%.o)

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

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

ifeq ($(MODE),release)
GCC_COMPILE_FLAGS += -O2
Expand Down
Loading

0 comments on commit 6663559

Please sign in to comment.