kernel threads

2001-01-04 Thread Marc Tardif
Are threads on FreeBSD 4.x implemented at the kernel level? If so, since when (I remember 2.x used MIT-threads, so I'm guessing at least since 3.x)? How can I see for myself that threads are really implemented at the kernel level? I looked around in /usr/src/sys/kern, but couldn't find anything

gcc builtin specs

2000-12-19 Thread Marc Tardif
When running the command gcc -v on FreeBSD 4.2-RELEASE, I get "Using builtin specs". On Linux, I get some path. How can I know which specs are used by the preprocessor, compiler, assembler and linker on FreeBSD then? PS. Should I have posted this question elsewhere? To Unsubscribe: send mail

Re: syscall assembly

2000-12-13 Thread Marc Tardif
On Thu, 14 Dec 2000, Iain Templeton wrote: > On Wed, 13 Dec 2000, Alfred Perlstein wrote: > > > subl $8,%esp > > addl $-8,%esp > > pushl $0 > > pushl $.LC0 > > call open > > > > why the subl then addl? > > > Well, as a thoroughly rough guess, the subl is

Re: syscall assembly

2000-12-13 Thread Marc Tardif
On Wed, 13 Dec 2000, Alfred Perlstein wrote: > * Marc Tardif <[EMAIL PROTECTED]> [001213 13:30] wrote: [ snip ] > > subl $8,%esp > > addl $-8,%esp > > pushl $0 > > pushl $.LC0 > > call open > > FreeBSD passes sy

syscall assembly

2000-12-13 Thread Marc Tardif
Considering the following C code: #include int main() { open("file", O_RDONLY); return 0; } compiled with gcc -S -O2, the following assembly code is generated: main: pushl %ebp movl %esp,%ebp subl $8,%esp addl $-8,%esp pushl $0 pushl $.LC0

basic block counting

2000-10-13 Thread Marc Tardif
How can I compile a program with basic-block counting enabled? When I try compiling with the -a flag, which should be what I need, this is what I get: /var/tmp/cczW87621.o(.stab+0x14): undefined reference to `LPBX0' /var/tmp/cczW87622.o(.stab+0x14): undefined reference to `LPBX0' /var/tmp/cczW876

profiling a daemon process

2000-10-13 Thread Marc Tardif
I am trying to profile a daemon process, but no gmon.out file is ever created on FreeBSD. When I brought my code to Linux, I managed to get the graph profile file. First, I compiled everything with the -pg flag, as I would any other program. Then, I run the program which is forked to background a

aio_read timeout per request

2000-10-06 Thread Marc Tardif
If I initiate multiple aio_read requests on sockets, how can I set a timeout for each request? If I call aio_waitcomplete, that sets a timeout for all. So, if I have 5 aio_reads, I would call aio_waitcomplete as many times in a loop waiting to process the first finished request. Problem with this

finding source to functions

2000-09-29 Thread Marc Tardif
How can I find the source to specific functions in /usr/src/sys? I tried running ctags (find /usr/src/sys/ -type f -print | xargs ctags -w), but it dumps core because it can't accept so many args. I then tried creating a tags file for each subdirectory like so: for i in /usr/src/sys/ do if test

kld/cdev won't compile

2000-09-29 Thread Marc Tardif
I'm currently running 4.1-RELEASE and can't compile the code in: /usr/share/examples/kld/cdev/module The command "make" returns the following to stderr: cdevmod.c:142: macro `DEV_MODULE' used with too many (6) args cdevmod.c:84: `nostop' undeclared here (not in a function) cdevmod.c:84: initializ

writing to disk

2000-09-28 Thread Marc Tardif
What is the quickest way of writing large amounts of data to disk? For example, if using the character device driver to write directly to a disk, is filling a track quicker than filling the same sector on each platter (ie the same column of sectors in a cylinger)? If filling a track is quicker, is

Re: Frustration with SCSI system

2000-09-20 Thread Marc Tardif
> > I've been using FreeBSD over the last 6 years (since I switched from > > NetBSD) to run a small ISP out of my basement. > > > > I've had about six disk crashes in as many years and still don't know how > > to work reliably with them. > > "man vinum" > > software mirroring == good. > What w

writing(2) to raw devices

2000-09-19 Thread Marc Tardif
>From The Design and Implementation of the 4.4BSD Operating System, the write(2) system call must go through vn_write(), ffs_write(), ffs_balloc(), cluster(), bio() and finally dev() which performs the actual disk write. Considering all this block-oriented overhead, how can dd(1) which calls write

device timings

2000-09-19 Thread Marc Tardif
Considering the following disk configuration: *** Working on device /dev/rwd0 *** parameters extracted from in-core disklabel are: cylinders=256 heads=132 sectors/track=63 (8316 blks/cyl) parameters to be used for BIOS calculations are: cylinders=256 heads=132 sectors/track=63 (8316 blks/

Re: device naming convention

2000-09-18 Thread Marc Tardif
> 0cicuta/home/babolo(9)#dd of=/dev/wd0s2 if=/dev/zero bs=660b > 1cicuta/home/babolo(11)#od -b /dev/wd0s2 [ snip ] > Why I use 2.2.7 for test? > Because of my lovely 4.1-STABLE is extremly unstable with content of > ad0s2 (wd0s2) above and silently reboot after the first dd in the test above. > A

Re: device naming convention

2000-09-18 Thread Marc Tardif
> > This is what I have in fdisk (from /stand/sysinstall): > > Offset SizeEnd Name PType Desc Subtype Flags > > 0 63 62- 6 unused0 > > 6319375651937627wd0s1 3freebsd 165 C > > 1937628 1

Re: device naming convention

2000-09-18 Thread Marc Tardif
[ snip ] > > Assuming /dev/wd0s2 contains a few blocks, ie /dev/wd0s1 > > doesn't span to the end of disk: > > 4. If I want to use /dev/wd0s2 as a raw slice for reading > >and writing, what are the steps to follow? > > None. You just use it. > This is what I have in fdisk (from /stand/sysins

Re: device naming convention

2000-09-16 Thread Marc Tardif
oks up every > slice to find FreeBSD label - even if you mark it 0 (unused) > How does it depend on usage? Are some formats preferable for some specific usage (consider I'll only be using the raw interface to the device)? [ snip ] Thanks for the first message, Marc Tardif To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

device naming convention

2000-09-16 Thread Marc Tardif
n asking on the FreeBSD mailing list? Thanks, Marc Tardif To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

Re: disassembling syscalls

1999-11-26 Thread Marc Tardif
On FreeBSD 2.2.5 (I know I should change, but it works), gcc 2.7.2.1, gdb 4.16, typing 'disassemble syscall_as_seen_in_main' I get: No function contains specified address. Using the same procedure on FreeBSD 3.3-RELEASE, gcc 2.7.2.3, gdb 4.18, I get some output which is shorter than I expected, b

disassembling syscalls

1999-11-26 Thread Marc Tardif
How can syscalls be disassembled on BSD? So far, I tried using ktrace -tc on compiled code using the syscall I wanted, but the output from kdump doesn't look like asm. I also tried using gdb directly, compiling the source with the -g and -static flags, but I couldn't use the disassemble command o

shared memory crash

1999-08-14 Thread Marc Tardif
I've been learning to program using shared memory and messages. As I write and debug, I often have to crash a running process which stalls. Of course, there is a problem with my code but that's all part of the learning process. The actual problem is that, after a few ctrl-c's, there isn't enough sp

shared memory crash

1999-08-14 Thread Marc Tardif
I've been learning to program using shared memory and messages. As I write and debug, I often have to crash a running process which stalls. Of course, there is a problem with my code but that's all part of the learning process. The actual problem is that, after a few ctrl-c's, there isn't enough s

prototypes with __P

1999-08-06 Thread Marc Tardif
While slowly reading the FreeBSD source code, I noticed odd prototype declarations which I haven't seen before. It looks something like this: int function __P((int)); or static int function __P((struct some_struct *some_pointer)); or anything similar. At first, I simply considered the "__P" as a s

prototypes with __P

1999-08-06 Thread Marc Tardif
While slowly reading the FreeBSD source code, I noticed odd prototype declarations which I haven't seen before. It looks something like this: int function __P((int)); or static int function __P((struct some_struct *some_pointer)); or anything similar. At first, I simply considered the "__P" as a

gdb instead of adb

1999-07-14 Thread Marc Tardif
Is the reason why adb hasn't been ported to freebsd because the source is proprietary? If gdb should suffice for my debugging needs, how can a breakpoint be set at a particular interrupt, or even at any interrupt? The break command only seems to accept functions, offsets, linenumbers and addresses

gdb instead of adb

1999-07-14 Thread Marc Tardif
Is the reason why adb hasn't been ported to freebsd because the source is proprietary? If gdb should suffice for my debugging needs, how can a breakpoint be set at a particular interrupt, or even at any interrupt? The break command only seems to accept functions, offsets, linenumbers and addresse

implementing a fs on a raw partition

1999-07-07 Thread Marc Tardif
As I reading on filesystem algorithms and principles [bach 86 and mckusick 96], I am tempted to try my hand on a free partition. From my understanding, I should be using the partition as a character device for raw i/o in order to avoid the current filesystem overhead (/dev/rwd0s3). From that point,

implementing a fs on a raw partition

1999-07-07 Thread Marc Tardif
As I reading on filesystem algorithms and principles [bach 86 and mckusick 96], I am tempted to try my hand on a free partition. From my understanding, I should be using the partition as a character device for raw i/o in order to avoid the current filesystem overhead (/dev/rwd0s3). >From that poin

Fatal trap 12 on startup

1999-06-13 Thread Marc Tardif
While installing 2.2.8R (from a CD which I got from cheapbytes) on a 486DX2 66, w/ 16Mb RAM, I get: > sc0 at 0x60-0x6f irq 1 on motherboard > sc0: VGA mono <16 virtual consoles, flags=0x0> > > Fatal trap 12: page fault while in kernel mode > fault virtual address = 0xefc0 > fault code

a.out behavior

1999-06-06 Thread Marc Tardif
The following code should obviously segfault: #include #include char buffer[4028]; void main() { int i; for (i=0; i<=4028; i++) buffer[i]='A'; syslog(LOG_ERR, buffer); } Now here's the problem: When compiling with "gcc file.c", the program segfaults. Whe

where's ADB (fwd)

1999-06-04 Thread Marc Tardif
-- Forwarded message -- Date: Sat, 5 Jun 1999 00:24:05 -0400 (EDT) From: Marc Tardif To: freebsd-questi...@freebsd.org Subject: where's ADB I've been on a few platforms and adb seems like a standard tool. Yet, it's nowhere to be seen on the Freebsd platform (

disassembling execve (fwd)

1999-06-04 Thread Marc Tardif
-- Forwarded message -- Date: Fri, 4 Jun 1999 18:39:35 -0400 (EDT) From: Marc Tardif To: freebsd-questi...@freebsd.org Subject: disassembling execve How can I disassemble the execve syscall? I tried compiling the following code: #include void main() { char *name[2