Skip to contentSkip to conversation

inserting a Forth-like language into the Linux kernel

DISCUSSION Rick Hohensee 1 participant 1 message May 5, 2001

lore
Share & tools
lore
#0 lore raw

In 2.4.0-test10, in my kspamd kernel-thread that's like a hollowed-out kswapd, I have x86 asm code like this...

[enter from in-kernel init]

[open 3 FDs on tty1]

LOOP:
pushf
pusha
call schedule
popa
popf

[ here is some code to use the write syscall to send
one byte to FD 1. A d, for example. ]

jmp LOOP

The d's get written until a syslog happens. If I do do_syslog(6,6,6); in the C kspamd wrapper code it's about like so...

<gobs of d's>ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddINIT: entering runlevel 8

[more normal logging stuff, ext2 warnings and so on]

If I don't do the do_syslog() the same thing happens somewhat earlier, i.e. on a from-the-kernel-itself syslog.

Boot is normal. I can't shift&pg_up vt1, which normally I can, but I can switch vt's, email you, etc. /proc/4/status for kspamd shows

Name:   kspamd
State:  R (running)
Pid:    4
PPid:   1

PIDs 1, 2 and 3 don't have any open FD's. My simplistic wrapper pegs CPU use at 1.0.

Why don't my d's continue?

Might this be easier to do in a 2.0 kernel?

Rick Hohensee
www.clienux.com