Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #7

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ jobs:
path: BaboscOS.iso

- name: Fetch tags
if: github.ref == 'refs/heads/main'
run: git fetch --tags

- name: Get latest tag
if: github.ref == 'refs/heads/main'
id: get_latest_tag
run: echo "latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV

- name: Determine version increment
if: github.ref == 'refs/heads/main'
id: determine_increment
run: |
if [[ "${{ github.event.pull_request.title }}" == *"minor"* ]]; then
Expand All @@ -45,6 +48,7 @@ jobs:
fi

- name: Increment version
if: github.ref == 'refs/heads/main'
id: increment_version
run: |
latest_tag=${{ env.latest_tag }}
Expand Down
4 changes: 2 additions & 2 deletions kernel/src/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ void _start(void) {
struct terminal term;
terminal_init(&term, framebuffer, COLOR_WHITE, 2);

terminal_write(&term, "BaboscOS booted up successfully!");
terminal_write(&term, "BaboscOS booted up successfully!BaboscOS booted up successfully!BaboscOS booted up successfully!BaboscOS booted up successfully!BaboscOS booted up successfully!");
terminal_edit(&term, COLOR_RED, 3);
terminal_write(&term, "red color and scale 3");
terminal_write(&term, "red color and scalesadasdasdsads 3");

// We're done, just hang...
hcf();
Expand Down
7 changes: 5 additions & 2 deletions kernel/src/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ void terminal_edit(struct terminal *term, uint32_t color, int scale) {
*/
void terminal_write(struct terminal *term, const char *str) {
int start_x = term->cursor_x;
int max_x = term->framebuffer->width - 8 * term->scale; // maximum x position before wrapping
while (*str) {
if (*str == '\n') { // if the character is a newline..
if (*str == '\n' || term->cursor_x > max_x) { // if the character is a newline or cursor exceeds max_x..
term->cursor_y += 8 * term->scale; // ..offset y
term->cursor_x = start_x; // ..and reset x
} else {
}
if (*str != '\n') {
terminal_write_char(term, *str);
term->cursor_x += 8 * term->scale; // offset x for each new character so they don't just print on top of each other
}
str++;
}
term->cursor_x = start_x;
}

/*
Expand Down
Loading