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

[kernel] Change heap and stack overflow kernel error messages, cleanup #2125

Merged
merged 1 commit into from
Dec 6, 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: 2 additions & 2 deletions elks/arch/i86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ void stack_check(void)
/* optional: check stack over min stack*/
if (current->t_regs.sp < current->t_begstack - current->t_minstack) {
if (current->t_minstack) /* display if protected stack*/
printk("(%P)STACK OVER MINSTACK by %u BYTES\n",
printk("(%P)STACK OUTSIDE PROTECTED LIMIT by %u\n",
current->t_begstack - current->t_minstack - current->t_regs.sp);
}

/* check stack overflow heap*/
if (current->t_regs.sp > end)
return;
}
printk("(%P)STACK OVERFLOW BY %u BYTES\n", end - current->t_regs.sp);
printk("(%P)STACK OVERFLOW by %u\n", end - current->t_regs.sp);
do_exit(SIGSEGV);
}

Expand Down
4 changes: 2 additions & 2 deletions elks/arch/i86/mm/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ int sys_brk(segoff_t newbrk)

if (current->t_begstack > current->t_endbrk) { /* stack above heap?*/
if (newbrk > current->t_begstack - current->t_minstack) {
printk("sys_brk(%d) fail: brk %x over by %u bytes\n",
current->pid, newbrk, newbrk - (current->t_begstack - current->t_minstack));
printk("(%d)CAN'T EXPAND HEAP by %u\n",
current->pid, newbrk - (current->t_begstack - current->t_minstack));
return -ENOMEM;
}
}
Expand Down
1 change: 1 addition & 0 deletions elks/tools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ bin/exomizer
bin/eman
bin/ewcc
bin/ewlink
bin/ecc
bin/fixomf
elftoolchain-0.7.1
bin/mattrib
Expand Down
7 changes: 5 additions & 2 deletions elks/tools/objtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CLEANDEP =

CLEANME = ../bin/objdump86 ../bin/omfdump ../bin/omf2elf \
../bin/os2toelks ../bin/os2dump \
../bin/ewcc ../bin/ewlink
../bin/ewcc ../bin/ewlink ../bin/ecc

DEPEND =

Expand All @@ -42,7 +42,7 @@ include $(BASEDIR)/Makefile-rules

CFLAGS += -Wall -Wextra -O3

all: ../bin/objdump86 ../bin/omf2elf ../bin/omfdump ../bin/os2toelks ../bin/os2dump ../bin/ewcc ../bin/ewlink
all: ../bin/objdump86 ../bin/omf2elf ../bin/omfdump ../bin/os2toelks ../bin/os2dump ../bin/ewcc ../bin/ewlink ../bin/ecc

../bin/objdump86: objdump86.o
$(CC) -o ../bin/objdump86 $(CFLAGS) $^
Expand All @@ -65,5 +65,8 @@ all: ../bin/objdump86 ../bin/omf2elf ../bin/omfdump ../bin/os2toelks ../bin/os2d
../bin/ewlink: ewlink
cp -p ewlink ../bin

../bin/ecc: ecc
cp -p ecc ../bin

#########################################################################
### Dependencies:
File renamed without changes.
3 changes: 1 addition & 2 deletions elks/tools/objtools/ewcc
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ WATCINCLUDE=$WATCOM/h
# -Wc,-wcd=N # disable warning N
# -Wc,-fpi87 # inline 8087 fp
# -Wc,-x # ignore INCLUDE environment variable
# -fno-stack-check # don't generate stack check code
# -fnostdlib # don't refere standard libraries
# unused:
# -fno-stack-check # don't generate stack check code
# -ztNum # specify far data threshold (default 32767, or 256 if no Num)
# -mhard-emu-float # -Wc,-fpi (inline 8087 w/emulation)
# -msoft-float # -Wc,-fpc
Expand All @@ -61,7 +61,6 @@ CCFLAGS="\
-Wc,-zev \
-Wc,-zls \
-Wc,-x \
-fno-stack-check \
-fnostdlib \
-Wall -Wextra \
-Wc,-wcd=303 \
Expand Down
Loading