Timing with clock_gettime(2) (sysutils/clockspeed port)

2002-12-23 Thread Mario Sergio Fujikawa Ferreira
Hi,

clockspeed is a port that Uses a hardware tick counter to
compensate for deviant system clock. From pkg-descr:

clockspeed uses a hardware tick counter to compensate for a persistently
fast or slow system clock. Given a few time measurements from a reliable
source, it computes and then eliminates the clock skew.

sntpclock checks another system's NTP clock, and prints the results in a
format suitable for input to clockspeed. sntpclock is the simplest
available NTP/SNTP client.

taiclock and taiclockd form an even simpler alternative to SNTP. They
are suitable for precise time synchronization over a local area network,
without the hassles and potential security problems of an NTP server.

This version of clockspeed can use the Pentium RDTSC tick counter or the
Solaris gethrtime() nanosecond counter.

Well, as you can see this port will not work without RDTSC
which means that it will not work in either alpha or sparc64 ARCHes. We
do not have gethrtime() but we have clock_gettime(2) as suggested
by Garret Wollman.

I did cook a small test program to find out how would I
would use clock_gettime(2) to achieve an output similar to that of
RDTSC.

I am using an idea taken from tar sources

((x)-t.tv_sec - (y)-t.tv_sec) + \
((x)-t.tv_nsec - (y)-t.tv_nsec) * 4294967296.0 / 1e9)

That's where the * 4294967296.0 / 1e9 came from.

However, my timing with clock_gettime() does not
sufficiently resembles that of RDTSC. I need a closer value. I'm
getting big differences as shown below.

Ideas? This will help us get yet another port
under both alpha and sparc64. :) My timing test code is attached.

Regards,

[exxodus:lioux:75]./timing  
RDTSC
Avg getpid() time = 4647397804253831496 nsec
clock_gettime()
Avg getpid() time = 4652939263933680218 nsec
[exxodus:lioux:76]./timing  
RDTSC
Avg getpid() time = 4647692649291935908 nsec
clock_gettime()
Avg getpid() time = 4652939075039020903 nsec
[exxodus:lioux:77]./timing  
RDTSC
Avg getpid() time = 4647378628771043082 nsec
clock_gettime()
Avg getpid() time = 4652939075039020903 nsec
[exxodus:lioux:78]./timing  
RDTSC
Avg getpid() time = 4647343972164535583 nsec
clock_gettime()
Avg getpid() time = 4652939263933680218 nsec
[exxodus:lioux:79]./timing  
RDTSC
Avg getpid() time = 4655770321416555069 nsec
clock_gettime()
Avg getpid() time = 4652939075039020903 nsec
[exxodus:lioux:80]./timing  
RDTSC
Avg getpid() time = 4647110875699447071 nsec
clock_gettime()
Avg getpid() time = 4652780781314515112 nsec
[exxodus:lioux:81]./timing  
RDTSC
Avg getpid() time = 4647597475565435617 nsec
clock_gettime()
Avg getpid() time = 4652939263933680218 nsec
[exxodus:lioux:82]./timing  
RDTSC
Avg getpid() time = 4647755189513323807 nsec
clock_gettime()
Avg getpid() time = 4653097557658186008 nsec
[exxodus:lioux:83]./timing  
RDTSC
Avg getpid() time = 4647490163230564680 nsec
clock_gettime()
Avg getpid() time = 4652939075039020903 nsec

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

#include sys/time.h
#include sys/types.h

#include stdio.h
#include unistd.h

void main(void) {

int i,iters = 100;

{
typedef struct { unsigned long t[2]; } timing;
#define timing_now(x) asm volatile(.byte 15;.byte 49 : 
=a((x)-t[0]),=d((x)-t[1]))
#define timing_diff(x,y) (((x)-t[0] - (double) (y)-t[0]) + 4294967296.0 * ((x)-t[1] 
- (double) (y)-t[1]))

timing start,end;

timing_now(start);
for (i = 0; i  iters; i++)
getpid();
 
timing_now(end); 
printf(RDTSC\n);
printf(Avg getpid() time = %lld nsec\n, 
timing_diff(end,start)/iters); 

}

{
typedef struct { struct timespec t; } timingi;
#define timing_nowi(x) ((void) clock_gettime(CLOCK_REALTIME, ((x)-t)))
#define timing_diffi(x,y) \
( \
(double) ( ((x)-t.tv_sec - (y)-t.tv_sec) + \
(double) ( \
((x)-t.tv_nsec - (double) (y)-t.tv_nsec) * 
4294967296.0 / 1e9 \
) \
) \
)

timingi start,end;

timing_nowi(start);
for (i = 0; i  iters; i++)
getpid();
 
timing_nowi(end);
printf(clock_gettime()\n);
printf(Avg getpid() time = %lld nsec\n, 
timing_diffi(end,start)/iters); 

}

}



Re: Timing with clock_gettime(2) (sysutils/clockspeed port)

2002-12-23 Thread Mario Sergio Fujikawa Ferreira
On Mon, Dec 23, 2002 at 12:23:34PM +0100, [EMAIL PROTECTED] wrote:
 In message [EMAIL PROTECTED], Mario Sergio Fuji
 kawa Ferreira writes:
 
 clockspeed uses a hardware tick counter to compensate for a persistently
 fast or slow system clock. Given a few time measurements from a reliable
 source, it computes and then eliminates the clock skew.
 
 Uhm, have you heard about ntpd ? 

Yeah, I have but I want to port this one. :)
It does its job fine as well. I do run ntpd in most installations
but clockspeed in some.

Besides, it's about porting it not discussing merits. heheh

Regards,

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Creating a sysctl? (mission impossible)

2002-08-22 Thread Mario Sergio Fujikawa Ferreira

On Wed, Aug 21, 2002 at 08:08:20PM -0700, David Schultz wrote:
 Thus spake Mario Sergio Fujikawa Ferreira [EMAIL PROTECTED]:
  I am trying to create one sysctl so that I can read information
  from a lottery scheduler that I am trying to write.
  The sysctl is very very simple. I add a lottery node under kern
  then add a member global_tickets under kern.lottery. Very simple stuff
  that is not working.
 
 FYI, lottery scheduling has already been implemented at least
 twice for FreeBSD.  For an example, see

I know about the other implementations. However, this is
for my graduation course. Therefore, I will be implementing it.  It
would much better if it was suitable for proper inclusion in the
kernel. Besides, since this is for my graduation course, I have
avoiding checking similar implementations to avoid design plagiarization.
Nevertheless, I might check similar implementations to get some
ideas now that I'm reaching the higher level abstractions.

[snip]

 The code has not been maintained, apparently due to a lack of
 interest, and it incurs a high scheduling overhead.  Note that the KSE

Well, the high overhead has usually been due to the design
implementation. It is usually due to the data structure used for
holding the processes in the scheduler. Aside from that, the only
really expensive call is random(). I am trying to use least expensive
design in this code but I am aware of this possible caveat.

 work is likely to bring significant changes to scheduling in FreeBSD,
 possibly causing you headaches later.  You might also be interested in

I know. :) But since I need this working in the next week,
I can't really risk trying -CURRENT. I'll have to port this to
-CURRENT later since I want all of Waldspurger's proportional
schedulers eventually merged into the FreeBSD distribution. Of
course, if I can convince -arch ppl that this worth it. Also, users
that desire lottery scheduler desire it most for the different
policy not exactly for less overhead though I'll try to keep the
overhead to a minimum.

 Luigi's work on a PS scheduler; check the list archives.

I will but my current priority is getting lottery
scheduler to a working least expensive shape. I think I am going
to contact Luigi, he probably has experience with some of the
problems I am facing.

ps: by the way, for those tracking this from archives. The solution
for the sysctl problem is

o Problem: Although, the sysctl symbols could be found in the kernel
  through 'nm /kernel', 'sysctl -a' did not show them.
o Solution: Add header file sys/kernel.h which requires sys/param.h
o Reason: SYSCTL_* uses the DATA_SET macro, which is in linker_set.h,
  which is included by kernel.h. If you didn't have it, DATA_SET
  was giving weird declaration warnings, but i guess since there
  was nothing in the file it didn't matter when linked [1]

Submitted by:   ah-zeep [1]

So a correct example for adding any sysctl has the following
template:

#include sys/param.h
#include sys/kernel.h
#include sys/sysctl.h

SYSCTL_NODE(_kern, OID_AUTO, lottery, CTLFLAG_RD, 0,
Lottery scheduling parameters);

SYSCTL_UINT(_kern_lottery, OID_AUTO, global_tickets, CTLFLAG_RD,
global_tickets, 0, Current global tickets);

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Creating a sysctl? (mission impossible)

2002-08-20 Thread Mario Sergio Fujikawa Ferreira

Hi,

This is for -STABLE system as of August 15th.

$ uname -a
FreeBSD Here.here 4.6-STABLE FreeBSD 4.6-STABLE #8: Tue Aug 20 14:42:43 BRT 2002 
[EMAIL PROTECTED]:/usr/src/sys/compile/LIOUX  i386

I am trying to create one sysctl so that I can read information
from a lottery scheduler that I am trying to write.
The sysctl is very very simple. I add a lottery node under kern
then add a member global_tickets under kern.lottery. Very simple stuff
that is not working.
Here follows the sample I am using. I used kern_poll.c as
example.

1) Created a file kern_lottery.c which is attached. Then,
placed this file under /usr/src/sys/kern/kern_lottery;
2) Then, added a reference for it in both /usr/src/sys/conf/files
and /usr/src/sys/conf/options. Check attached patch-lottery;
3) Then, added options SCHEDULER_LOTTERY to a kernel
config file. Compiled, installed, rebooted.

Here follows the results after the reboot:

$ nm /kernel | grep -i lotter
c0237ee0 d sysctl___kern_lottery
c0237f20 d sysctl___kern_lottery_global_tickets
c0264238 B sysctl__kern_lottery_children

$ sysctl -a  |  grep -i lot
$ sysctl -A  |  grep -i lot

As you can see, sysctl returns nothing even though the
relevant symbols are in the kernel. It knows nothing about the
lottery node. I can reproduce this problem in 2 different boxes
with different versions of -STABLE.
The relevant sysctl code follows:

typedef _BSD_PID_T_ ticket_t;   /* ticket type */

static ticket_t global_tickets = 0; /* XXX lottery */

SYSCTL_NODE(_kern, OID_AUTO, lottery, CTLFLAG_RW, 0,
Lottery scheduling parameters);
SYSCTL_UINT(_kern_lottery, OID_AUTO, global_tickets, CTLFLAG_RD,
global_tickets, 0, Current global tickets)

Any ideas why this is not working? Help plz. I hope you
guys know what I am doing wrong. IF I add this code to kern_switch.c,
everything works but it does not work when I add to kern_lottery.c
My 1st thought is that it does not like the fact that I'm
trying to create a node inside kern from another file. However,
kern_poll.c works like a charm.

Regards,

ps: please CC: me in your replies since I only receive digests of
this list.

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature


--- sys/conf/files.orig Tue Aug 20 14:48:54 2002
+++ sys/conf/files  Tue Aug 20 14:37:49 2002
@@ -572,6 +572,8 @@
 kern/kern_ktrace.c standard
 kern/kern_lock.c   standard
 kern/kern_lockf.c  standard
+# XXX lottery
+kern/kern_lottery.coptional scheduler_lottery
 kern/kern_malloc.c standard
 kern/kern_mib.cstandard
 kern/kern_ntptime.cstandard
--- sys/conf/options.orig   Tue Aug 20 14:49:02 2002
+++ sys/conf/optionsTue Aug 20 14:38:17 2002
@@ -468,3 +468,7 @@
 
 # Polling device handling
 DEVICE_POLLING opt_global.h
+
+# XXX lottery
+# Lottery scheduler
+SCHEDULER_LOTTERY  opt_sched_lottery.h


/*
 * Copyright (c) 2001, 2002
 * Mario Sergio Fujikawa Ferreira [EMAIL PROTECTED]
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $Fedaykin: src/sys/kern/kern_lottery.c,v 1.1.2.10 2002/08/19 19:37:34 lioux Exp $
 */

#ifdef SMP
#include opt_lint.h
#ifndef COMPILING_LINT
#error SCHEDULER_LOTTERY is not compatible with SMP yet
#endif
#endif

#include sys/types.h
#include sys/time.h
#include sys/sysctl.h

/* the process structure */
#include sys/param.h
#include sys/proc.h

#include stdlib.h
#include stdio.h

typedef _BSD_PID_T_ ticket_t;   /* ticket

Re: SurfBoard SB1000 cable modem in FreeBSD?

2002-01-31 Thread Mario Sergio Fujikawa Ferreira

On Wed, Jan 30, 2002 at 10:55:08PM -0600, mkm wrote:
 
  At first, I tried looking for support under FreeBSD but
  found none. Then, I tried to get it working under Linux since it
  seems to be supported. I'll spare the details since this is not the
  place for non-FreeBSD stuff. HEheh
 
 Ive got one, I just plugged it into my xl0, configured dhcp and I was up and 
 going.  Nothing fancy to get it going.

Are there external models? I thought it was implicit that
it was an internal Cable Modem. :(
Sorry, it is a SB1000 SurfBoard Internal cable modem for
downstream and a normal USR modem for upstream.

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: SurfBoard SB1000 cable modem in FreeBSD?

2002-01-30 Thread Mario Sergio Fujikawa Ferreira

On Wed, Jan 30, 2002 at 08:42:22AM -0500, raymond hicks wrote:
 uni-directional cable?  What kind of connection does your friend have? 

He lives in a area where both isdn and adsl do not work. Furthermore,
much for his dismay, bi-directional cable (actually radio) does not
work due to visibility issues.
Therefore, he is stuck with uni-directional downstream. Upstream
is handled by a 56K modem.

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



SurfBoard SB1000 cable modem in FreeBSD?

2002-01-29 Thread Mario Sergio Fujikawa Ferreira

Hi,

I was trying to help a friend get a SurfBoard SB1000
cable modem working in a Linux box much to my pain. I mean trying
because I failed horribly. :(
At first, I tried looking for support under FreeBSD but
found none. Then, I tried to get it working under Linux since it
seems to be supported. I'll spare the details since this is not the
place for non-FreeBSD stuff. HEheh
However, Linux has been such a pain to kernel configure
and system update (not to mention isapnp configure) that I am trying
to ask here if there is a beta around or anything that would even
remotely get a SurfBoard SB1000 working. I am sure that most of my
pain with Linux comes from my inexperience with it since I've been
mostly away for the past 4 years which I do not regret from the
damned questionary when I try to compile a kernel. No flame wars
please, I am sure people use it just fine. :)
Anyone? Ideas on how to get the linux kernel module
binary to work? Well, we were lucky with the aureal-kmod port.  More
information about it can be found at

- Original driver written for Linux by Franco Venturi in 1998
http://www.jacksonville.net/~fventuri/

The driver can be found under any Linux kernel at
drivers/net/sb1000.[ch]
No flames please. I know the card is old but my
friend has no choices.

Regards,

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



rxvt terminal detection patch

2001-12-05 Thread Mario Sergio Fujikawa Ferreira

Hi,

I received the following email regarding terminal
detection. Does this looks sane? Any comments?
I will add this to the rxvt port if I get positive
feedback.
I believe it is correct but I thought I should ask
a broader audiance.

Regards,

- Forwarded message from  -

To: [EMAIL PROTECTED]
Date: Wed, 12 Sep 2001 16:08:15 +1000 (EST)
Message-Id: [EMAIL PROTECTED]
Subject: rxvt patch


Hi there,
I have been having problens with rxvt that does not exist in an normal xterm.
I was giving me an error message:

can't open pseudo-tty

I traced this to the get_pty() func in command.c and found FreeBSD uses
the PTYS_ARE_SEARCHED define. This is OK except I also found that the
PTYCHAR1 and PTYCHAR2 defs did not seam to include all the ptys on
a FreeBSD machine. We have many users here and it did not take long before
there were no ptys left in the seach. We have all 256 configured.

Here is the patch that got me working. I was using the /usr/ports/x11/rxvt
(rxvt-2.6.3). Hope this helps.

--- src/command.c.orig  Wed Sep 12 15:41:30 2001
+++ src/command.c   Wed Sep 12 15:42:37 2001
@@ -321,8 +321,8 @@
ptydev = pty_name;
ttydev = tty_name;
 
-# define PTYCHAR1  pqrstuvwxyz
-# define PTYCHAR2  0123456789abcdef
+# define PTYCHAR1  pqrstuvPQRSTUV
+# define PTYCHAR2  0123456789abcdefghijklmnopqrstuv
for (c1 = PTYCHAR1; *c1; c1++) {
ptydev[len] = ttydev[len] = *c1;
for (c2 = PTYCHAR2; *c2; c2++) {


-- 
Daryl Sayers
Corinthian Engineering Ph: (02) 9906 7866
Suite 19, 401 Pacific Hwy Fax: (02) 9906 1556
Artarmon, NSW, 2064 email: [EMAIL PROTECTED]
Australia www: http://www.cordoors.com.au


- End forwarded message -

-- 
Mario S F Ferreira - DF - Brazil - I guess this is a signature.
Computer Science Undergraduate | FreeBSD Committer | CS Developer
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



bug in shell `` expansion code?

2001-09-21 Thread Mario Sergio Fujikawa Ferreira

Hi,

While working on a make .mk code, I and Chris Wasser (TDF
on IRC) came across an interesting behavior:

sh -c 'TDF=echo a  echo b;for i in `${TDF}`; do echo i:$i; done'

This should return:

i:a
i:b

instead, it returns:

i:a
i:
i:echo
i:b

If this is not a bug, how do we get it working?

Regards,

-- 
Mario S F Ferreira - UnB - Brazil - I guess this is a signature.
lioux at ( freebsd dot org | linf dot unb dot br )
flames to beloved [EMAIL PROTECTED]
feature, n: a documented bug | bug, n: an undocumented feature

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



a mtools wrapper (slight better control)

2001-02-01 Thread Mario Sergio Fujikawa Ferreira

Hi,

Here is my problem:

I need to enable a group of workstations running XDM 
accesses to local disk floppies with FAT16/32 FS(es). Therefore, I
considered ports/emulators/mtools.
All users will have access to the floppy drives.
All workstations will permit remote shell emulation
(sshd,...).  Thus, there can be a local and several remote users
on all workstations.

HOWEVER, I would like to only permit the local
logged user accesses to the floppy through mtools. I need this
because this lab is considered hostile environment and remote
users might try to be fun destroying other ppls floppy files.
Before, I get any complains I considered doing something.

Here is what I though:

1) Create user floppy, group floppy
2) chown root:floppy /dev/fd0* 
3) chmod 0660 /dev/fd0*
4) write a wrapper replacing /usr/local/bin/mtools

mtools - /usr/local/bin/mtools_real
wrapper - /usr/local/bin/mtools

The wrapper will:

1) Sanitize the environment a la ports/x11/wrapper
2) First, check if the user trying mtools is the user
locally logged through XDM. Second, I do not considered su (su from
any other user) users locally logged. Third, I am still deciding
the ruling about the remote logged with the same username (uid).
2nd and 3rd will depend on the ease to implement.
3) The wrapper will be installed sugid

chown root:floppy /usr/local/bin/mtools
chmod 2005 /usr/local/bin/mtools

therefore, if (1) and (2) go well, the wrapper will run mtools_real
with the appropriate privileges.

The workstations will be running FreeBSD 4.x-Stable
with XFree 4.0.2 from ports.

The design seems fine, adding a simple, yet interesting
level of control over mtools. However, how does one achieve item
(2) of the wrapper design?

1) getuid to get the user running the wrapper
2) geteuid for additional checking
3) get through PAM the user who logged through XDM
4) crosscheck to see if running user match XDM user
5) check if the running process associated terminal is not
a remote terminal (ssh, ...)
6) check if this a su user

The list came from a mental exercise. However, I
have no idea if this is feasible. Is this correct?  How do I do
3-6? What could I do differently?

Hope this is not out of line, or plainly in the wrong
list.

Regards,

-- 
Mario S F Ferreira - UnB - Brazil - "I guess this is a signature."
lioux at ( freebsd dot org | linf dot unb dot br )
flames to beloved [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: make release: how I do make it into a bootable cd?

2000-08-09 Thread Mario Sergio Fujikawa Ferreira

On Tue, Aug 08, 2000 at 05:36:26PM -0500, Alan Edmonds wrote:
 This was brought up last week; I'm not sure if it was this list.
 
 See /usr/share/examples/worm for a couple of scripts used
 to create the FreeBSD release CDs.  Very informative.
 
 Ben Smithurst wrote:
  
  Mario Sergio Fujikawa Ferreira wrote:
  
 1) (cont.) I could use burncd but I am bugged by the fact
   that I can't use cdrecord. :)
  
  Why?  I think it was designed for SCSI devices, and you don't have one, so
  just use burncd.
  
 2) How do I make it a full-fledged FreeBSD bootable
   distribution CDRom? I mean, where do I get the el-torrito boot
   image? How do I make it use it and then run sysinstall seamlessly?
  
  Use floppies/boot.flp as the boot image, see "man mkisofs" for how to
  set the boot image.
  

Thanks to you both.
As per the not being able to use cdrecord, I was just
wondering if I could somehow access the atapi through an
abstration layer such as ASPI. Who knows? Thanks though, I'll
stick to burncd. :)

Regards,
Mario Ferreira


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



make release: how I do make it into a bootable cd?

2000-08-08 Thread Mario Sergio Fujikawa Ferreira

Hi,

I know I should know better. Please do not flame me.  Well,
I did a good 1st make release on my little stable (cvsupped
07/08/2000) machine. I have disc[12] under cdrom. Everything looks
fine. But  (there is always a but)

Does anyone have a 'burn the CD' cookbook? This is what I
have so far (pretty obvious); of course, the same applies to disc2.

1) mkisofs -o disc1.iso -R -J disc1 
- create a filesystem with RockRidge and Joliet extensions
2) cdrecord -v speed=s4 dev=something disc1.iso

However, I have a few doubts:

1) What sort of device should I use? cdrecord -scanbus is
not returning anything. I am trying to use an ATAPI recorder but
I do not know what to use. Besides, what should I use for my cdrom
reader? Trying /dev/acd0c for my recorder returns

--
Cdrecord 1.9 (i386-unknown-freebsd4.1) Copyright (C) 1995-2000 Jörg
Schilling
cdrecord: No such file or directory. Cannot open SCSI
driver.
cdrecord: For possible targets try 'cdrecord -scanbus'.
Make sure you are root.
--- I am running it as root. Odd.

---
ahc0: Adaptec 2940 SCSI adapter port 0xb800-0xb8ff mem
0xe804-0xe8040fff irq 5 at device 9.0 on pci0
ahc0: aic7870 Single Channel A, SCSI Id=7, 16/255 SCBs
acd0: CD-RW CD-RW CRX100E at ata1-master using PIO3
cd0 at ahc0 bus 0 target 5 lun 0
cd0: PLEXTOR CD-ROM PX-40TS 1.04 Removable CD-ROM SCSI-2 device 
--- dmesg useful info

---
FreeBSD Fedaykin.here 4.1-STABLE FreeBSD 4.1-STABLE #0: Sun Aug
7 14:13:58 BRT 2000 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/LIOUX
i386
--- uname -a

1) (cont.) I could use burncd but I am bugged by the fact
that I can't use cdrecord. :) The devices are a Sony CRX100 CDR
and a Plextor Ultraplex 40max CDRom.

2) How do I make it a full-fledged FreeBSD bootable
distribution CDRom? I mean, where do I get the el-torrito boot
image? How do I make it use it and then run sysinstall seamlessly?
Just like a disc1 from distribution.  Well, FreeBSD distribution
won't be comming to town anytime soon and I only have a 33.6K
connection to the internet; therefore, this would really prove
handy while I wait. Can I try the /boot/cdboot stuff or the
floppies/boot.flp as a boot image?

3) Any tips to make it a complete distribution CDRom are
welcome.

Regards,
Mario Ferreira

ps: Looks like this belongs in, yet, another FAQ entry.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



ADSL pci modem drivers?

2000-08-03 Thread Mario Sergio Fujikawa Ferreira

Hi,

Does anyone have any information on ADSL
modems under FreeBSD? Driver progress and stuff?
Any PCI cards at all? Mainly the 3com
homeconnect.

http://www.3com.com/client/pcd/homeconnect/dsl/pci.html

Regards,
Mario Ferreira


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sysutils/memtest and FreeBSD

2000-07-22 Thread Mario Sergio Fujikawa Ferreira

Daniel,

On Sun, Jul 23, 2000 at 12:01:53AM +0900, Daniel C. Sobral wrote:
 Mario Sergio Fujikawa Ferreira wrote:
  
  Backtracing showed that the problem was due
  to the malloc function inside the get_mem function.
  get_mem() is used to find out the largest possible memory segment.
  It incrementaly reduces the segment passed to malloc to alloc.
  It is the malloc function allright. It core dumps on the
  1st pass on get_mem(), there is no time to do_reduce. Very weird. ;(
 
 Because FreeBSD overcommits, malloc() will only fail in case of
 artificial limits being reached (like those of login.conf). If FreeBSD
 suddenly finds itself in a position of not being able to meet the
 previous commitments wrt to memory allocation, it will kill the
 application with the largest memory allocations.
 
 I'll bet you the fifth season of Babylon 5 this is what's happening. :-)

Are you willing to bet the 3rd and 4th seasons as well?
The 4th season rocks. ;-)

 Try limiting the maximum memory allocation to the total physical RAM.

The code sets limits appropriatily with RLIMIT_MEMLOCK and
RLIMIT_RSS with setrlimit().
Furthermore, I am not using any limits for the user testing
the program (a can do it all user :).
Besides, a failing malloc should return NULL, shouldn't
it? I would have expected core if I had malloc_options="X" which
I do not (in fact, I have no malloc_options).

Regards,
Mario Ferreira

ps: Perhaps you could check the code, it is only 11K long.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



/etc/defaults/make.conf:LEAPSECONDS= true?

2000-07-21 Thread Mario Sergio Fujikawa Ferreira

Hi,

I was wondering if this should go inside
/etc/defaults/make.conf.

--- /usr/src/etc/defaults/make.conf Sun Jul 16 05:30:30 2000
+++ /tmp/make.conf  Fri Jul 21 18:42:35 2000
@@ -41,6 +41,9 @@
 # To build perl with thread support
 #PERL_THREADED=true
 #
+# Compile zoneinfo with correct leap second handling 
+#LEAPSECONDS=  true
+#
 # To avoid building various parts of the base system:
 #NO_CVS=   true# do not build CVS
 #NO_BIND=  true# do not build BIND

If it does not, where in the handbook should
I drop a note about it, besides FAQ (of course).

Regards,
Mario Ferreira


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



sysutils/memtest and FreeBSD

2000-07-21 Thread Mario Sergio Fujikawa Ferreira

Hi,

I just added sysutils/memtest to the FreeBSD ports tree a
couple of days ago. It is a utility to test for faulty memory
subsystem.
However, I've been having some problems with it.
They are not fatal, but really annoying. I am in contact with
the author to try working them out.
Nonetheless, I would like to see if ppl on the
-hackers forum could help me out with the following problem:

I noticed that using 'memtest all' would produce
core dump on my -stable as of 18/07/2000.
Backtracing showed that the problem was due
to the malloc function inside the get_mem function.
get_mem() is used to find out the largest possible memory segment.
It incrementaly reduces the segment passed to malloc to alloc.
It is the malloc function allright. It core dumps on the
1st pass on get_mem(), there is no time to do_reduce. Very weird. ;(

#0  0x280dda41 in isatty () from /usr/lib/libc.so.4
#1  0x280ddd91 in isatty () from /usr/lib/libc.so.4
#2  0x280de4c5 in malloc () from /usr/lib/libc.so.4
#3  0x8049427 in get_mem () at memtest.c:338
#4  0x8048bc5 in main (argc=2, argv=0xbfbff62c) at memtest.c:175
#5  0x80488e1 in _start ()

Instead of just returning a null pointer, it core dumps.
I am not using any /etc/malloc.conf options at all. I know
that 'A' could produce this.

Following some instructions from the author, I tried
an odd change ... since that is his baby not mine. However,
it did not work.

On Thu, Jul 20, 2000 at 08:12:12PM -0600, Charles Cazabon wrote:
 Mario Sergio Fujikawa Ferreira [EMAIL PROTECTED] wrote:

 Try changing line 103 to allocate a buffer of 256 bytes instead of 100 bytes.
 I haven't looked at that line in a long time.  The output messages may be 
 longer than that now.
 
 If that's not it, it's crashing during the memory allocation phase.  I twould
 take some additional debugging to figure out where.

It did not work. 'memtest all' still core dumps.
By the way, one bug that is not FreeBSD related though,
whenever I try 'memtest 4G':

---
./memtest 4G
memtest v. 2.93.1
(C) 2000 Charles Cazabon [EMAIL PROTECTED]
Original v.1 (C) 1999 Simon Kirby [EMAIL PROTECTED] [EMAIL PROTECTED]

./memtest:  amount of memory to allocate too small.
---

Nonetheless, using 1G, 2G, 3G and 5G work. Just to mention.
Don't worry about it. I am not touching the bit wise code now. I
am leaving that to the author. I am worried about the core dump
amongst other projects now.

Regards,
Mario Ferreira


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message