hl> Where is the pkg_add (and related) code supposed to be?
hl> I can't find it. I've been looking at:
hl> http://fxr.watson.org/fxr/source/?v=RELENG62
http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/pkg_install/add/
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
_
Howdy list,
A tutorial introduction to the ELF(3)/GELF(3) API set is
available for review at the following URL:
"libelf by Example"
http://people.freebsd.org/~jkoshy/download/libelf/article.html
The intent is to add this tutorial to our documentation
collection.
Features:
- Covers the basics
Further, after installation how should i ensure that all the
required kernel sources are installed?
You want the sources to the complete system, not just
the "kernel", and you would want to keep these upto-date
too. See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html
a
This time I am interested in the operational principle
of the port/package system, what is going on while
installing packages, and where is the source files if
I want to do some modification?
See /usr/src/usr.sbin/pkg_install/*
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
__
Recently noticed that our sed(1) differs from its GNU
analog in that in -i mode it considers all files as a
single sequence of lines while the latter treats each file
independently. The in-line mode isn't in POSIX, so it isn't
really clear which way is correct.
Aren't sed's addresses required t
So, could anyone please give me a detailed
explanation of how to open a file in kernel and write to it - best data
types to use, functions, what to look out for, maybe a link to tutorial
or manual that deals with this (if such a thing exists), etc.?
I'm not aware of such a tutorial. I would sug
ls> So, I'm looking for a way to manually open up a file from within
ls> kernel space and dump characters into it.
des> Note that it opens the file in userland and passes it down to the
des> kernel. You may want to consider a similar mechanism.
hwpmc(4) takes a similar approach, using a dedicat
jk> You may need a regular i386 or amd64 PC to run FreeBSD on 'bare metal'.
mp> pmc: Unknown Intel CPU.
mp> module_register_init: MOD_LOAD (hwpmc, 0xc05b0114, 0xc3662094) error 78
mp> It seems, the module can't achieve initalization.. please help !
When the time comes for hooking up your GUI to
[Trimming soc-admins@ from the CC list]
mp> do you recommend a method to get active processes in a python script,
mp> as with "ps" or "top" in order to put the result into a list ? (python
mp> package, shell call...)
One option would be to wrap "kvm_getprocs(3)" and use that.
mp> PS: I would li
mp> I copied libpmc.so and tryed 'import libpmc'. I have:
mp> ImportError: dynamic module does not define init function (initlibpmc)
mp> Are we really far from having a libpmc module ?
You may want to browse the following articles in Python's
documentation set:
"Extending and Embedding the P
I'm pleased to offer a patch implementing callchain capture for
hwpmc(4) for review.
Test reports, comments etc. are welcome.
Regards,
Koshy
=
Summary
hwpmc(4):
* hwpmc(4) can now walk kernel and user stacks and capture caller
informatio
> OK, this is the famous problem with modern CPUs that jkoshy has declined
> to work around :( There are patches for this in perforce, see
>
> http://perforce.freebsd.org/changeView.cgi?CH=126189
"Famous problem" indeed :). I declined the patch because it
is incorrect and incomplete.
First,
> I have tried it for measuring number of instructions. But I am in doubt
> that instructions is a correct counter for performance measurement as
> different instructions may have very different execution times depending
> on many reasons, like cache misses and current memory traffic. I have
> trie
> Thanks, I have already found this. There was only problem, that by
> default it counts cycles only when both logical cores are active while
> one of my cores was halted.
Did you try the 'active' event modifier: "p4-global-power-events,active=any"?
> Sampling on this, profiler shown results clos
Hello List(s),
I am very pleased to announce a patch, by Fabien Thomas, that brings
PmcTools' callchain capture features to 7-STABLE. Thank you, Fabien!
The patch is linked to from the PmcTools wiki page:
http://wiki.freebsd.org/PmcTools.
The current file name is: "patch-callchain-FreeBSD-7-STA
> Does it mean that hwpmc from now will work "out of the box" with new Intel
> core2 duo/quad processors (like T7500) ?
No, someone needs to write the appropriate CPU-dependent
module for that.
For those who are interested in doing so, there is a HowTo
document at:
http://wiki.freebsd.org/PmcT
> Well, I think we want to inform this through actual measurement. Right now,
> tools like hwpmc track cache misses by point in executable code, but what
> would be nice is if we could post-process to generate cache miss information
> by data structure field...
That is one of the tools that I
> I would like to obtain fore mentioned data from within my module. I need
> these performance metrics to see how certain code executes, and make
> decisions during the runtime. pmc(3) seems complete, but it also seems to be
> intended for use in the userland.
>
> How to use pmc from modules? Is th
> In the program given below the function readlink gets called up when
> printf is executed and the program ends without any output.
>
> readlink is a system call (syscall number = 58) which is being made by
> the printf function, but according to my understanding of system call,
> it is made by pu
> - Am I not following the correct procedures to
> allocate and deallocate memory in kernel space ??
> - Or is the problem elsewhere ??
You didn't say whether you've checked your code for buffer
overruns.
If the fault is happening in seemingly unrelated parts of
the kernel with your module is e
The Wikipedia page referenced below says that UFS2 supports a
filesystem size of 2^80 Bytes (1YiB) with the limit on a given
file being 2^55 bytes (32 PiB).
Are these numbers correct? I somehow remember the limits as
being much lower (of the order of 16TB or so).
http://en.wikipedia.org/wiki/C
> I am one of the firmware guys that is writing a Secondary Boot Loader that
> boots
> FreeBSD kernel. From what I see in the ELF header for FreeBSD kernel, the load
> address seems to have a value of 0x8020 which seems to be a Virtual
> address
> for me. If I want to put the Physical addre
k> freebsd 53 idles on
k>
k> WARNING: / was not properly dismounted
k> start_init: trying /sbin/init
k> ==
Does /sbin/init exist? Does it match the /sbin/init on a
'good' partition?
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
> Is there anyone who can explain me, why when i say 'kill -HUP >
> id', and its failed to restart, kill say nothing?
> It is such an easy to implement...
Your application could be choosing to ignore SIGHUP
(restarting on SIGHUP is a convention, not a OS defined
requirement)?
--
FreeBSD Volunteer
> Why? I'm wondering if this is the problem as both ports and
> doc are not populated.
>
> Any suggestions, ideas?
The ports and doc collections use tags of the form RELEASE_X_Y_Z,
while src uses RELENG_X_Y_Z_RELEASE.
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
__
> In what version of FreeBSD (or libc) these functions (sin, cos,
> tan, ...) were implemented?
Are you linking with libm?
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/
> #-
> options KTR
> options KTR_ENTRIES=8192
> options KTR_VERBOSE
...
> Am i missing something very important ?
What is the value of sysctl debug.ktr.mask?
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
f
> In various kernel source files,i came across '#ifdef _KERNEL'.
> What is '_KERNEL' used for ? In some files _KERNEL is #defined to nothing ??
> Can anybody please explain this ?
It is used to control the visibility of types and prototypes in system headers.
Kernel builds define _KERNEL
ak> options, perc4 controller set-up, etc. The keyboard works
ak> fine also if I boot into single user mode. However, if
ak> I do a normal boot into multi-user mode (the keyboard
ak> works fine when selecting a boot option) then when I
ak> get to the login prompt, no keyboard input at all.
I worke
> What is the equiv of this in Free BSD? /boot/kernel doesn't seem to work on
> lilo and I'd really like to use it for booting and I've done it before, that
> and Free BSD didn't want to boot Linux at first (Was my fault) so does anyone
> know... Actually I'm assuming you do know because that's why
yt> - tried to install the world over NFS on an old Pentium
yt> machine with some 5.3-BETA;
AFAIK, the only 'supported' installation mode is to have
the installworld step running on the same machine that did
the build. I.e., you need to export '/' from the old
Pentium box, mount it somewhere on y
dc> As to answer the question - I am not aware of any facility for
dc> automatically restarting things (unless you can get init to do
dc> it via /etc/ttys somehow)
Wasn't there a port of launchd in the wings?
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
vg> I wrote a piece of software that has to get the current
vg> timestamp, one way or the other, a huge number of times per
vg> second. Apart from the empyrical tests one can perform to
vg> find out the timekeeping scheme with the less performance
vg> impact, is there any rule of thumb as to what c
ps> Can anybody tell me that why there are two different structures named
ps> 1)struct sigcontext
ps> 2)struct osigcontext
ps> are defined in /sys/i386/include/signal.h
ps> I want to know what is basic difference between them?
% cvs log -r1.10 /usr/src/sys/i386/include/signal.h
% cvs log -r1
L4Linux exists, but it seems to be more of a means for testing out
and developing the L4 microkernel, but would there be any practical
reason to sandbox the FreeBSD kernel and force it to run as a user-
land service on top of the L4::Pistachio kernel? (for example)
Well, you could do neat stuff
I tried the 'ln -s' command in bothe 4.3 & 4.7 in a
situation where it should fail and it did, but it still had
a return/exit code of 0 , I think it should have been
nonzero. I tried 'ln -s a b' where the file b existed
(and was a directory) and I wanted to create the file named
a also p
but this doesnt function right. so i see the behavior from
$myline in the while-loop like an local variable..
If you are looking for function local variables,
use the "local" keyword. For example:
a.sh
a=1
f()
{
local a
a=2
echo B: In f: $a
}
echo A: Outside
jml> I've found some other compilers on the web:
jml> http://fabrice.bellard.free.fr/tcc/ (LGPL)
dn> tcc is very fast, probably has the most modern C parser of
dn> the lot, and might even be able to build world except that
dn> the shared binaries it generates aren't able to be loaded
dn> by our
That's their commercial decision - as a result, if you
their cards, you may end up with a particularly expensive
paperweight the day they decide you need to buy a new card
for your new version of freebsd which has different
internals; or someone finds bugs in their drivers that
they wont fix.
Th
I'm compiling "make" (usr.bin/make), but when I try to execute
it I got the following results:
[snip]
'Tis a bug in your toolchain. e_ident[EI_OSABI] in the ELF
header isn't being set correctly for static executables.
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
Where can i find source of subj?
/usr/src/lib/libc/gen/getlogin.c has
the declaration of this function, but i'm unable
to find its definition.
Its generated as part of the C library build. See:
src/lib/libc/i386/sys/Makefile.inc
src/lib/libc/sys/Makefile.inc
sys/lib/libc/i386/SYS.h
--
FreeBSD
get a pid of a daemon-process and then somehow trace routing
socket messages coming in / going out from the kernel to that
particular daemon ?
`ktrace -p DAEMON-PID` might be what you want.
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
_
I am experimenting with modifying a kernel module and I need
to be able to open/read/write/close a file from within the
module. Is there a preferred way to do this? Are there any
locking or buffering issues that I need to be aware of?
sys/kern/kern_alq.c:alq_open() and sys/kern/kern_ktrace.c:k
Is there any supported way to make installkernel directly to some
directory. I want to build two kernels (like /boot/kernel.SMP/ and
/boot/kernel.UP/) in my installation script and DESTDIR is quite useless
is this case.
make installkernel KERNCONF=YOUR_KERNEL_HERE KODIR=/boot/testkernel
S
I'm trying to use pmcstat to profile userspace time used in
Squid. I just can't seem to get pmcstat to report anything
useful.
The last thing I tried was something like:
# pmcstat -O file -P instructions -t
# pmcstat -R file -g
# ls k7-retired-instructions
kernel.gmon
There doesn't seem to be
Squid is running but there's no profiling information for it
still..
Could you run grep the output of `pmcstat -R' (no "-g")
for mention of the squid processes pids.
Also, try pmcstat -v -v (for a breakup of the buckets).
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
frequency but something else in addition. A posting in the
thread said variations less than 0.1% were not problematic.
However, the poster said it was an issue in a dual cpu, dual
core system he had set up.
Why would application code care about CPU frequencies?
Is it trying to measure its 'per
.if exists= ${PREFIX}/etc/rc.d
exit
else
${MKDIR} ${PREFIX}/etc/rc.d
.endif
but it doesn't work.
Can someone give me the right syntax?
.if exists(${PREFIX}/etc/rc.d)
.else
.endif
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
free
kr> I would like to understand how the shell is tied to the
kr> console port.
Google for 'controlling terminal'. "Advanced
Programming in the Unix Environment" by Richard Stevens
is a good book for Unix basics.
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
> I can't find the source to files_getstate *anywhere* in /usr/src.
> Can anyone tell me where to find this missing function/macro?
Try "src/lib/libc/include/nss_tls.h":
...
static int \
name##_getstate(struct name##_state **p)
> want to rebuild the whole kernel every time i add a few new lines or a
If you use config(8) to configure your kernel in the "traditional way",
this should come for free.
See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html
_
> I would like to find a method which determines the current number of
> active CPUs.
> Is there a better method than checking that sysctl and divide the
> hw.ncpu by two if set?
You are probably looking for:
min(number of '0' bits in machdep.hlt_cpus, hw.ncpu)
___
> I don't think there is a streight way to speed-up the default
> unix time resolution, which is, as far as i know, in
> microseconds.
On i386 (and possibly amd64) platforms you can use the
RDTSC instruction to get a direct measure of processor
cycles elapsed.
--
FreeBSD Volunteer, http://peop
> If you mist do this, the general set of steps are:
>
> 1. use namei() to convert a pathname to a vnode
> 2. Use vn_open(), vn_rdwr(), and vn_close() to operate on the vnode.
> 3. Observe proper vnode locking and reference counting with vref(),
> vn_lock(), and vput()
Take a look at "sys/kern/ke
If you'd like approximate activity levels by committer,
try something like:
% cd /cvs/FreeBSD/CVSROOT-src/commitlogs # choose repository
% gzip -dcfq * | awk '
/^[a-z][a-z]*/ { count[$1]++ } \
END { for (c in count) { print count[c], c } } ' | \
sort -nr | less
...
7193 jkh
6864 peter
668
> How can I debug the core dump file created by kernel panic? I try to use "gdb
> -core vmcore.0" (vmcore.0 is 4G file because I have 4G memory) and the gdb
> said: this is not a vaild core file. Why?
AFAIK you have to use 'gdb -k' (or 'kgdb') to use GDB's kernel debugging mode.
--
FreeBSD Vo
> First one is in general abt the method to be followed, I
> have the following ideas ... [snip]
Have you looked at netgraph(4) and ng_socket(4)?
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
freebsd-hackers@freebsd.org mailing list
http:
> execve(), and at the start of init. The kernel print statement is
> shown, however the init statement is not.
> Any clues?
1) Does the execve() invocation of 'init' succeed (errno == 0)?
2) What is the value of 'init_path'. Which executable is finally selected to
serve as 'init'?
3) Doe
> (probe1:ahd0:0:1:0): No or incomplete CDB sent to device.
> (probe1:ahd0:0:1:0): Protocol violation in Message-in phase.
> Attempting to abort.
> (probe1:ahd0:0:1:0): Abort Message Sent
> (probe1:ahd0:0:1:0): SCB 14 - Abort Tag Completed.
> found == 0x1
> ahd0: Invalid Sequencer interrupt occurre
> I already visited int80h.org and linuxassembly.org and others, And did not
> find any resources or include files..
> If anyone can share his own files, or give any tips, would be nice.
It is straightforward:
The assembly syntax is whatever is supported by gas(1) for
your architecture. 'info ga
> Here are the headers needed in case someone reads this thread:
>
> #include /*needed only for NULL, can be removed*/
> #include
> #include
> #include
> #include
> #include
According to the manual page for psignal(9) in -current, you
only need and .
You need to hold the PROC lock for th
> ifconfig em1 inet 205.229.165.8 netmask 255.255.255.0 up
ifconfig em1 alias ALIAS-ADDRESSS netmask NETMASK
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listin
> sleep_on_timeout() call in Linux . (dont' want to waste the CPU cycles
You may want to try the manual pages.
% man -k sleep | fgrep '(9)'
endtsleep(9), sleepinit(9), unsleep(9) - manage the queues of sleeping processes
init_sleepqueues(9) ... sleepq_wai
> What is the proper method for submitting cores along with
> backtraces to the FreeBSD development team? Is it useful to
> submit cores, or is the backtrace sufficient?
Firstly, GNATS works over email and sending in a 4GB+ MIME
encoded core file could overload the mail servers of not
just th
> Please point me to right direction, because i've got only one
> idea left: grep dynamic loader for LD_PRELOAD ;).
Doesn't dlsym() with handle RTLD_DEFAULT work?
--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
freebsd-hackers@freebsd.org
> where's a good place for kernel programming documentation ?
In no particular order:
1. The FreeBSD Developer's Handbook.
2. The FreeBSD Architecture Handbook.
3. The book 'The Design and Implementation of the FreeBSD
Operating System', by Kirk McKusick and George
Neville-Neil.
3. The sect
> How can I get the process_id of a process when I've the
> process_name from within a C program? Also can the command
You could look at the way its done in
"src/usr.bin/killall/killall.c", or read the manual page
for kvm_getprocs(3).
> kill (pid, SIGCONT) be used to restart a dead daemon proces
vijay> Is this a known issue? How can I get around this?
Likely causes include flaky RAM, overclocking and CPU
overheating. Did the machine get through a full buildworld
cycle previously?
You can check your CPU temperature with 'mbmon'.
roman> gcc has just been upgraded to 3.4.4 so I expect a
> I'm trying to get beastie.4th to allow me to select either
> amd64 or i386 as my running system. I can get this to happen
> from the boot loader using:
> set currdev=disk1s1d
> set rootdev=disk1s1d
> unload
> load /boot/kernel/kernel
> load /boot/kernel/acpi.ko
> load /boot/kernel/hptmv.ko
> boo
> I am trying to check that a process (struct proc) has root
> powers when it calls my KLD system call.
Don't you get a 'struct thread *' as an argument to your
system call entry point?
The 'flag' argument to suser_cred(9) is documented in its
manual page.
--
FreeBSD Volunteer, http://peop
av> "Hello World" assembly program written in 64bit assembly
av> which I can compile and run on my FreeBSD,AMD64 platform
You could also look at "src/lib/libc/amd64/SYS.h" for how
system calls are implemented. In particular,
#define KERNCALLmovq %rcx, %r10; syscall
A system call trans
> Is this analysis correct? Can someone point me to the (a?)
> standard that describes this. The FreeBSD behaviour makes
> sense, I am trying to understand what is the expected
> behaviour on other platforms.
>From "The Open Group Base Specifications Issue 6"
http://www.cnop.net/docs/susv3/funct
Sridhar,
> I heard that even Interrupts run under kernel threads context
See ithread(9).
> How can a kernel thread yield CPU when it detects it is idle?
kthread_suspend(), or yield(). See kthread(9), mi_switch(9).
Let me also answer your questions(s) at another level: I have found
informati
You could use ktrace(1) to determine what the ftpd daemon is actually doing.
rh> Is the user's shell listed in /etc/shells? It must be there for ftpd to
rh> let them in.
vt> I run FreeBSD 4.3-STABLE machine. I use ftpd for ftp server
daemon. It has
vt> very strange behavior with one of use
jason> features, but whenever I tried to run startx after Xorg
-configure had finished
jason> running, the screen would flash then simply go back out to the
console with the
The X server's log (/var/log/X*.log) should tell you what went wrong. A common
problem is that you are trying to run X with
On Thu, 28 Oct 2004 21:30:45 -0300, Allan Marshall <[EMAIL PROTECTED]> wrote:
> The box has been quite unstable, with restarts every few days
> this is the first dump ive got with DDB
> I realize this likely isnt enough information, but if you could point me in the
> right direction
> I can provid
Hi -hackers,
I'm looking for ways that a userland program can determine the CPU
features available on an SMP machine -- processor model, stepping
numbers, supported features, cache organization etc.
For example, on some x86 processors the CPUID instruction could be
used to determine some of the
Hi Bruce,
A few thoughts on your API:
1) Rather than naming the struct's as "l1", "l2" etc, it may be more
orthogonal to use an array of cache entries like so
struct entry { ... } entries[MAX_ENTRIES]; where MAX_ENTRIES would be say,
8.
2) We could pass information back about whether
78 matches
Mail list logo