KernelTrap, OS/kernel, Linux, FreeBSD, Life, NetBSD, GNU/Hurd, OpenBSD, Applications/tools, Other, Nothing, Me, Personal, Linux, FreeBSD

The Relation between `skb->len' and `skb->data_len' and What They Represent

Submitted by Eus
on June 1, 2008 - 8:16am

This writing is based on Linux kernel 2.6.21.5.

If skb is linear (i.e., skb->data_len == 0), the length of skb->data is skb->len.

How to Differentiate between EOF and a Character whose ASCII code is 255

Submitted by Eus
on June 1, 2008 - 8:05am

A call to fgetc() or getchar() will return EOF if the end-of-file has been reached.
As far as I know, GNU C Library defines EOF to be (-1).

Those who are unwary will think that those functions return a char.
Now a char has a range from 0x00 to 0xFF because its size is one byte.
However, if EOF is returned as a char, which must take one value from the range, there will be no way to differentiate whether or not the returned char is actually a byte read from the stream or EOF to signal that the end-of-file has been reached already.

stupid functional extention keys; back to flexible UI and keyboard in the first place

Submitted by olecom
on May 26, 2008 - 2:04pm

ACPI-fied or driverized extention keys on keyboard on laptop are just stupid. There are 100 keys, they need even more and ugly.

'Fn' on laptops. Why all extentions: backlight, sound volume, etc. cannot be done for one hand: Fn+1 Fn+2.. Fn+q Fn+w.. Fn+a Fn+s?

I doubt this frozen 'Fn' thing is even needed at all. Again, more flexible UI and keyboard in the first place are needed! EOF

Ordinary headphones (e.g. with long cable) and simple user control of playback.

Submitted by olecom
on May 25, 2008 - 9:07pm

Ordinary headphones with volume potentiometer. What if i need just next/prev song and stop/start playback commands? By sensing resistance of the load/output current on amplifier all can be acheived (by two buttons):

* either left or right resistance is high (no volume, small current) -- prev./next
* both are high -- stop if playing, play if stoped (or on/off chain + application decides)

Cort Dougan: Good Programmers are not Lazy. unpublished draft.

Submitted by olecom
on May 23, 2008 - 6:04pm


http://hq.fsmlabs.com/~cort/papers/lazy/lazy.nohead.html
Abstract:
In this article I provide a practical analysis of programming practices and education. The phrase ``Good programmers are lazy'' is very often offered to students as a guide to good programming. This statement is very wrong and reflects some of the problems with attitudes in computer science today.

sed howto: stripping slack from webserver files, per-line block transformations and speed optimizations

Submitted by olecom
on May 23, 2008 - 10:37am

I claim to be a `sed` lover, not guru (generally bad term), not geek. Since seders is closed private group (stupid, huh), i'd like to post something interesting and useful here.

Tutorials, i know, and could find in google all have silly examples and suck. Let's do a HOWTO for real-life stuff.

to ccurtis about text user interaface

Submitted by olecom
on May 22, 2008 - 8:25pm

> Would this make for a better links than elinks?

Run Borland Pascal 7.0 in dosbox to see what Turbo Vision was. Help system there is a nice browser, nither of today's lynx, links or elinks or whole www has. Pictures and flash are mostly spam, many don't know how to turn off.

dialog -> ncurses -> |stdout(ESC) -> tty -> vga_console |-> video RAM/frame buffer

insmod: error inserting 'x.ko': -1 Invalid module format

Submitted by Eus
on May 22, 2008 - 7:07am

That error message is issued because a version mismatch occurs when the Linux kernel module to be inserted into the working kernel was not compiled with the source code that was used to compile the working Linux kernel.

Where `skb->len' is set so that ip_rcv() can directly perform `skb->len < iph->tot_len'?

Submitted by Eus
on May 22, 2008 - 6:47am

As an example, let's use Realtek 8139 as the NIC.

In Linux kernel 2.6.21.5, I traced from drivers/net/8139cp.c starting at the place where an SKB is admitted at the very first time:

cp_rx_poll(): desc = &cp->rx_ring[rx_tail];
 |            status = le32_to_cpu(desc->opts1);
 |            len = (status & 0x1fff) - 4;
 |
 V
dev_alloc_skb(): skb->len = 0
 |
 V

fidi: file/directory choosing widget (not that much but something); moving to text editor

Submitted by olecom
on May 21, 2008 - 7:46am
shown concepts:
o `sh && sed && stty && dd` flexible patterns and no `find`, built-in `dd`
  are needed; mc, ncurses, readline are not
o key-vectors (tab is fixed origin)
o +,-,[,] keys - flexible UI config.
* tty backend needed: true windowing (move, overlap), stack-based coloring
  (easy multi-context highlighting).

#!/bin/sh: command modifiers: CPU affinity, ASLR, lightweight exec, capabilities

Submitted by olecom
on May 19, 2008 - 4:37pm
sed '' << 'EOF'
http://thread.gmane.org/gmane.comp.shells.dash/73
Let's listen to silence again now...

Update:
`set -F[rnd:$(read_ethernet_now)]` -- another choice
( # if there's no that much network activity:
wget