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] Update syscall buffer verify FAULT to show bad address #2216

Merged
merged 1 commit into from
Feb 3, 2025
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
2 changes: 1 addition & 1 deletion elks/arch/i86/mm/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int verfy_area(void *p, size_t len)
if (seg_verify_area(current->pid, current->t_regs.ds, offset))
return 0;

printk("FAULT\n");
printk("FAULT at user DS %04x:%04x size %u\n", current->t_regs.ds, p, len);
return -EFAULT;
}

Expand Down
2 changes: 2 additions & 0 deletions libc/watcom/asm/divmod.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ include struct.inc
; divides DX:AX / [BX]
; returns DX:AX with remainder in [BX]

push cx
xor cx,cx ; temp CX = 0
cmp dx,[bx] ; is upper 16 bits numerator less than denominator
jb short fast ; yes - only one DIV needed
Expand All @@ -38,6 +39,7 @@ include struct.inc
div word ptr [bx] ; AX = lower numerator / base, DX = remainder
mov [bx],dx ; store remainder
mov dx,cx ; DX = high quotient, AX = low quotient
pop cx
ret

__divmod endp
Expand Down
Loading