Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

freebsd-hackers Digest, Vol 365, Issue 2

0 views
Skip to first unread message

freebsd-hac...@freebsd.org

unread,
Mar 23, 2010, 8:00:13 AM3/23/10
to freebsd...@freebsd.org
Send freebsd-hackers mailing list submissions to
freebsd...@freebsd.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
or, via email, send a message with subject or body 'help' to
freebsd-hac...@freebsd.org

You can reach the person managing the list at
freebsd-ha...@freebsd.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of freebsd-hackers digest..."


Today's Topics:

1. Re: nroff -man, .An Aq formatting (Dag-Erling Sm?rgrav)
2. [patch] teach the bootloader minor amd64 knowledge
(Alexander Best)
3. Re: Logical CPUs cannot be disabled via W3520 (John Baldwin)
4. Re: [patch] teach the bootloader minor amd64 knowledge
(John Baldwin)
5. dumping on a small swap partition (Dominic Fandrey)
6. [patch] somebody please fix this outstanding mmap(2) bug
(Alexander Best)
7. Re: [patch] teach the bootloader minor amd64 knowledge
(Alexander Best)
8. Re: [patch] somebody please fix this outstanding mmap(2) bug
(Alexander Best)
9. Re: nroff -man, .An Aq formatting (Christian Weisgerber)
10. Re: Logical CPUs cannot be disabled via W3520 (Garrett Cooper)
11. Re: nroff -man, .An Aq formatting (Joerg Sonnenberger)
12. Re: [patch] teach the bootloader minor amd64 knowledge
(John Baldwin)
13. Re: [patch] teach the bootloader minor amd64 knowledge
(Alexander Best)
14. Re: [patch] somebody please fix this outstanding mmap(2) bug
(John Baldwin)
15. Re: [patch] somebody please fix this outstanding mmap(2) bug
(Alexander Best)
16. Re: [patch] somebody please fix this outstanding mmap(2) bug
(John Baldwin)
17. PR commit requests (Garrett Cooper)
18. kenv - output needed (Atom Smasher)
19. Re: nroff -man, .An Aq formatting (Dominic Fandrey)
20. Re: nroff -man, .An Aq formatting (Dominic Fandrey)
21. Strange behavior of kernel module (output terminated)
(Dmitry Krivenok)
22. Re: Strange behavior of kernel module (output terminated)
(Dag-Erling Sm?rgrav)


----------------------------------------------------------------------

Message: 1
Date: Mon, 22 Mar 2010 14:27:16 +0100
From: Dag-Erling Sm?rgrav <d...@des.no>
Subject: Re: nroff -man, .An Aq formatting
To: Doug Barton <do...@FreeBSD.org>
Cc: Dominic Fandrey <kami...@bsdforen.de>,
freebsd...@freebsd.org
Message-ID: <86634oj...@ds4.des.no>
Content-Type: text/plain; charset="utf-8"

Doug Barton <do...@FreeBSD.org> writes:
> Dominic Fandrey <d...@des.no> writes:
> > It has come to my attention that whereas with LANG=C "nroff -man"
> > formats ".An name Aq email" as "name <email>", it uses different
> > characters with LANG=en_GB.UTF-8 "name ⟨email⟩". These characters
> > are appropriate, but a lot of unicode fonts don't seem to have them.
> AFAIK our standard is -mdoc, not -man. Is there a specific purpose for
> which you need -man? And if not does the problem exist with -mdoc?

Yes to the latter.

This is definitely a bug, since (as avg@ points out) you can no longer
copy-paste the name & address into an email client.

AFAIK (judging from the Unicode group they're in) these characters are
intended mainly for writing things like <ENTER> and <CTRL>+<F1> in
technical documentation.

I've attached a patch.

--
Dag-Erling Smørgrav - d...@des.no

-------------- next part --------------
A non-text attachment was scrubbed...
Name: groff-angle-brackets.diff
Type: text/x-patch
Size: 517 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20100322/3e614fb8/groff-angle-brackets-0001.bin

------------------------------

Message: 2
Date: Mon, 22 Mar 2010 14:50:05 +0100 (CET)
From: Alexander Best <alexb...@wwu.de>
Subject: [patch] teach the bootloader minor amd64 knowledge
To: <freebsd...@FreeBSD.org>
Message-ID:
<permail-20100322135005f...@message-id.uni-muenster.de>

Content-Type: text/plain; charset="us-ascii"

hi there,

since i386 and amd64 are sharing the same bootcode the bootloader gets named
"FreeBSD/i386" on amd64 too. the following patch is a cosmetic change to have
the bootloader identify itself as "FreeBSD/amd64" on amd64.

any thoughts on this one?

--
Alexander Best
-------------- next part --------------
Index: sys/boot/i386/boot2/boot2.c
===================================================================
--- sys/boot/i386/boot2/boot2.c (revision 205390)
+++ sys/boot/i386/boot2/boot2.c (working copy)
@@ -283,7 +283,11 @@

for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
+#ifdef FAKE_I386
+ printf("\nFreeBSD/amd64 boot\n"
+#else
printf("\nFreeBSD/i386 boot\n"
+#endif
"Default: %u:%s(%u,%c)%s\n"
"boot: ",
dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,
Index: sys/boot/i386/Makefile.inc
===================================================================
--- sys/boot/i386/Makefile.inc (revision 205390)
+++ sys/boot/i386/Makefile.inc (working copy)
@@ -10,7 +10,7 @@
LDFLAGS+= -nostdlib

.if ${MACHINE_ARCH} == "amd64"
-CFLAGS+= -m32 -march=i386
+CFLAGS+= -m32 -march=i386 -DFAKE_I386
LDFLAGS+= -m elf_i386_fbsd
AFLAGS+= --32
.endif
Index: sys/boot/i386/zfsboot/zfsboot.c
===================================================================
--- sys/boot/i386/zfsboot/zfsboot.c (revision 205390)
+++ sys/boot/i386/zfsboot/zfsboot.c (working copy)
@@ -730,7 +730,11 @@

for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
+#ifdef FAKE_I386
+ printf("\nFreeBSD/amd64 boot\n"
+#else
printf("\nFreeBSD/i386 boot\n"
+#endif
"Default: %s:%s\n"
"boot: ",
spa->spa_name, kname);
Index: sys/boot/i386/loader/Makefile
===================================================================
--- sys/boot/i386/loader/Makefile (revision 205390)
+++ sys/boot/i386/loader/Makefile (working copy)
@@ -6,7 +6,11 @@
LOADER?= loader
PROG= ${LOADER}.sym
INTERNALPROG=
+.if ${MACHINE_ARCH} == "amd64"
+NEWVERSWHAT?= "bootstrap loader" amd64
+.else
NEWVERSWHAT?= "bootstrap loader" i386
+.endif

# architecture-specific loader code
SRCS= main.c conf.c vers.c
Index: sys/boot/i386/gptboot/gptboot.c
===================================================================
--- sys/boot/i386/gptboot/gptboot.c (revision 205390)
+++ sys/boot/i386/gptboot/gptboot.c (working copy)
@@ -281,7 +281,11 @@

for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
+#ifdef FAKE_I386
+ printf("\nFreeBSD/amd64 boot\n"
+#else
printf("\nFreeBSD/i386 boot\n"
+#endif
"Default: %u:%s(%up%u)%s\n"
"boot: ",
dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,

------------------------------

Message: 3
Date: Mon, 22 Mar 2010 09:47:53 -0400
From: John Baldwin <j...@freebsd.org>
Subject: Re: Logical CPUs cannot be disabled via W3520
To: Garrett Cooper <yane...@gmail.com>
Cc: FreeBSD-Hackers <freebsd...@freebsd.org>, Colin Percival
<cper...@freebsd.org>
Message-ID: <20100322094...@freebsd.org>
Content-Type: Text/Plain; charset="iso-8859-1"

On Sunday 21 March 2010 6:40:17 pm Garrett Cooper wrote:
> Someone on the forums [1] noticed that machdep.hlt_logical_cpus
> was unavailable on their system, and I did some poking around and
> noticed that it was as well. Should SMT logical CPUs be disable(-able)
> via machdep.hlt_logical_cpus as well or is it just classic HTT based
> chips?

I suspect that it should work for SMT as well.

> Thanks,
> -Garrett
>
> $ sysctl machdep.
> machdep.acpi_timer_freq: 3579545
> machdep.enable_panic_key: 0
> machdep.adjkerntz: 25200
> machdep.wall_cmos_clock: 1
> machdep.disable_rtc_set: 0
> machdep.acpi_root: 1029056
> machdep.disable_mtrrs: 0
> machdep.idle: acpi
> machdep.idle_available: spin, mwait, mwait_hlt, hlt, acpi,
> machdep.hlt_cpus: 0
> machdep.prot_fault_translation: 0
> machdep.panic_on_nmi: 1
> machdep.kdb_on_nmi: 1
> machdep.tsc_freq: 2694121808
> machdep.i8254_freq: 1193182
> $ sysctl hw.machine hw.model
> hw.machine: amd64
> hw.model: Intel(R) Xeon(R) CPU W3520 @ 2.67GHz
>
> dmesg snippet:
>
> CPU: Intel(R) Xeon(R) CPU W3520 @ 2.67GHz (2694.12-MHz K8-class
CPU)
> Origin = "GenuineIntel" Id = 0x106a5 Family = 6 Model = 1a Stepping =
5
>
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
>
Features2=0x9ce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,SSE4.2,POPCNT>
> AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
> AMD Features2=0x1<LAHF>
> TSC: P-state invariant
> real memory = 12884901888 (12288 MB)
> avail memory = 12379992064 (11806 MB)
> ACPI APIC Table: <091109 APIC2100>
> FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
> FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads
> cpu0 (BSP): APIC ID: 0
> cpu1 (AP): APIC ID: 1
> cpu2 (AP): APIC ID: 2
> cpu3 (AP): APIC ID: 3
> cpu4 (AP): APIC ID: 4
> cpu5 (AP): APIC ID: 5
> cpu6 (AP): APIC ID: 6
> cpu7 (AP): APIC ID: 7
>
> [1] http://forums.freebsd.org/showthread.php?t=12527
>

--
John Baldwin


------------------------------

Message: 4
Date: Mon, 22 Mar 2010 10:50:32 -0400
From: John Baldwin <j...@freebsd.org>
Subject: Re: [patch] teach the bootloader minor amd64 knowledge
To: freebsd...@freebsd.org
Cc: Alexander Best <alexb...@wwu.de>
Message-ID: <20100322105...@freebsd.org>
Content-Type: Text/Plain; charset="iso-8859-15"

On Monday 22 March 2010 9:50:05 am Alexander Best wrote:
> hi there,
>
> since i386 and amd64 are sharing the same bootcode the bootloader gets named
> "FreeBSD/i386" on amd64 too. the following patch is a cosmetic change to
have
> the bootloader identify itself as "FreeBSD/amd64" on amd64.
>
> any thoughts on this one?

I would not do this. They really are the same binary. You can take a
/boot/loader built under FreeBSD/i386 and use it to load an amd64 kernel and
vice versa. The one change I looked at doing a while back was renaming the
i386/amd64 boot bits to identify themselves as 'FreeBSD/x86' rather than
'FreeBSD/i386'.

--
John Baldwin


------------------------------

Message: 5
Date: Mon, 22 Mar 2010 16:02:26 +0100
From: Dominic Fandrey <kami...@bsdforen.de>
Subject: dumping on a small swap partition
To: freebsd...@freebsd.org
Message-ID: <4BA78682...@bsdforen.de>
Content-Type: text/plain; charset=UTF-8

The swap partition of my notebook is only 4gb small, whereas the
system has 8gb of RAM.

Is there a way to convince the system of dumping despite this?
The system panics quite often since I crossed the 4gb memory
boundary and it never dumps. I think that a minidump should in
most cases fit well into my swap space.

I'm running RELENG_8.

Regards

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


------------------------------

Message: 6
Date: Mon, 22 Mar 2010 16:07:43 +0100 (CET)
From: Alexander Best <alexb...@wwu.de>
Subject: [patch] somebody please fix this outstanding mmap(2) bug
To: <freebsd...@FreeBSD.org>
Message-ID:
<permail-20100322150743f...@message-id.uni-muenster.de>

Content-Type: text/plain; charset=us-ascii

could somebody please commit this patch? it's been around forever (2003 or
2004) and fixes mmap so the offset argument is being ignored when MAP_ANON is
defined (just like the mmap(2) manual says). right now the offset argument is
being taken into account although MAP_ANON is set!!!

the pr is kern/71258 (including a little c app to demonstrate the bug)

i've also sent a followup patch to the pr which returns EINVAL if the offset
is non zero and MAP_ANON is set, but i guess that might break some code.

the attached patch has originally been written by Martin Kammerhofer. i've
modified it a bit so it attaches cleanly to HEAD (r205390).

--
Alexander Best


------------------------------

Message: 7
Date: Mon, 22 Mar 2010 16:20:10 +0100 (CET)
From: Alexander Best <alexb...@wwu.de>
Subject: Re: [patch] teach the bootloader minor amd64 knowledge
To: John Baldwin <j...@freebsd.org>, <freebsd...@freebsd.org>
Message-ID:
<permail-201003221520108...@message-id.uni-muenster.de>

Content-Type: text/plain; charset=us-ascii

John Baldwin schrieb am 2010-03-22:
> On Monday 22 March 2010 9:50:05 am Alexander Best wrote:
> > hi there,

> > since i386 and amd64 are sharing the same bootcode the bootloader
> > gets named
> > "FreeBSD/i386" on amd64 too. the following patch is a cosmetic
> > change to
> have
> > the bootloader identify itself as "FreeBSD/amd64" on amd64.

> > any thoughts on this one?

> I would not do this. They really are the same binary. You can take
> a
> /boot/loader built under FreeBSD/i386 and use it to load an amd64
> kernel and
> vice versa. The one change I looked at doing a while back was
> renaming the
> i386/amd64 boot bits to identify themselves as 'FreeBSD/x86' rather
> than
> 'FreeBSD/i386'.

sounds nice. however that would introduce some severe inconsistency, because
the term 'i386' is used in many places to define the x86 architecture (uname
-p/-m e.g.). also 'x86' related files/directories are called 'i386'.

personally i'd like to see the term 'i386' completely replaced by 'x86'
throughout the whole freebsd code.

if i'm not mistaken 80386 has been dropped in GENERIC in freebsd4 and entirely
in freebsd5.

--
Alexander Best


------------------------------

Message: 8
Date: Mon, 22 Mar 2010 16:22:37 +0100 (CET)
From: Alexander Best <alexb...@wwu.de>
Subject: Re: [patch] somebody please fix this outstanding mmap(2) bug
To: <freebsd...@FreeBSD.org>
Message-ID:
<permail-201003221522378...@message-id.uni-muenster.de>

Content-Type: text/plain; charset="us-ascii"

oops. forgot the patch. ;)

--
Alexander Best
-------------- next part --------------
Index: sys/vm/vm_mmap.c
===================================================================
--- sys/vm/vm_mmap.c (revision 205390)
+++ sys/vm/vm_mmap.c (working copy)
@@ -241,19 +241,23 @@
((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE)))
return (EINVAL);
flags |= MAP_ANON;
- pos = 0;
}

- /*
- * Align the file position to a page boundary,
- * and save its page offset component.
- */
- pageoff = (pos & PAGE_MASK);
- pos -= pageoff;
+ /* If MAP_ANON has been set the offset argument is being discarded. */
+ if (flags & MAP_ANON) {
+ pageoff = pos = 0;
+ } else {
+ /*
+ * Align the file position to a page boundary,
+ * and save its page offset component.
+ */
+ pageoff = (pos & PAGE_MASK);
+ pos -= pageoff;

- /* Adjust size for rounding (on both ends). */
- size += pageoff; /* low end... */
- size = (vm_size_t) round_page(size); /* hi end */
+ /* Adjust size for rounding (on both ends). */
+ size += pageoff; /* low end... */
+ size = (vm_size_t) round_page(size); /* hi end */
+ }

/*
* Check for illegal addresses. Watch out for address wrap... Note
@@ -300,7 +304,6 @@
handle = NULL;
handle_type = OBJT_DEFAULT;
maxprot = VM_PROT_ALL;
- pos = 0;
} else {
/*
* Mapping file, get fp for validation and

------------------------------

Message: 9
Date: Mon, 22 Mar 2010 15:05:52 +0000 (UTC)
From: na...@mips.inka.de (Christian Weisgerber)
Subject: Re: nroff -man, .An Aq formatting
To: freebsd...@freebsd.org
Message-ID: <ho810g$19g0$1...@lorvorc.mips.inka.de>
Content-Type: text/plain; charset=UTF-8

Dag-Erling Smørgrav <d...@des.no> wrote:

> > > It has come to my attention that whereas with LANG=C "nroff -man"
> > > formats ".An name Aq email" as "name <email>", it uses different
> > > characters with LANG=en_GB.UTF-8 "name ⟨email⟩". These characters
> > > are appropriate, but a lot of unicode fonts don't seem to have them.
>
> This is definitely a bug, since (as avg@ points out) you can no longer
> copy-paste the name & address into an email client.
>
> AFAIK (judging from the Unicode group they're in) these characters are
> intended mainly for writing things like <ENTER> and <CTRL>+<F1> in
> technical documentation.

And we probably have that usage in other man pages. It is not clear
to me if the problem is the use of these characters for angle quotes
or the use of .Aq for email addresses.

A few days ago, I switched my desktop to UTF-8, and I right away
noticed that there are issues with the nroff output. Looking at,
say, the rc(8) man page, I see that the `...` shell backquotes have
been turned into pretty single quotes. Again, you can't copy-n-paste
this any longer.

--
Christian "naddy" Weisgerber na...@mips.inka.de

------------------------------

Message: 10
Date: Mon, 22 Mar 2010 08:38:09 -0700
From: Garrett Cooper <yane...@gmail.com>
Subject: Re: Logical CPUs cannot be disabled via W3520
To: John Baldwin <j...@freebsd.org>
Cc: FreeBSD-Hackers <freebsd...@freebsd.org>, Colin Percival
<cper...@freebsd.org>
Message-ID: <232074FC-7E18-41BB...@gmail.com>
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes

On Mar 22, 2010, at 6:47 AM, John Baldwin <j...@freebsd.org> wrote:

> On Sunday 21 March 2010 6:40:17 pm Garrett Cooper wrote:
>> Someone on the forums [1] noticed that machdep.hlt_logical_cpus
>> was unavailable on their system, and I did some poking around and
>> noticed that it was as well. Should SMT logical CPUs be disable(-
>> able)
>> via machdep.hlt_logical_cpus as well or is it just classic HTT based
>> chips?
>
> I suspect that it should work for SMT as well.
>
>> Thanks,
>> -Garrett
>>
>> $ sysctl machdep.
>> machdep.acpi_timer_freq: 3579545
>> machdep.enable_panic_key: 0
>> machdep.adjkerntz: 25200
>> machdep.wall_cmos_clock: 1
>> machdep.disable_rtc_set: 0
>> machdep.acpi_root: 1029056
>> machdep.disable_mtrrs: 0
>> machdep.idle: acpi
>> machdep.idle_available: spin, mwait, mwait_hlt, hlt, acpi,
>> machdep.hlt_cpus: 0
>> machdep.prot_fault_translation: 0
>> machdep.panic_on_nmi: 1
>> machdep.kdb_on_nmi: 1
>> machdep.tsc_freq: 2694121808
>> machdep.i8254_freq: 1193182
>> $ sysctl hw.machine hw.model
>> hw.machine: amd64
>> hw.model: Intel(R) Xeon(R) CPU W3520 @ 2.67GHz
>>
>> dmesg snippet:
>>
>> CPU: Intel(R) Xeon(R) CPU W3520 @ 2.67GHz (2694.12-MHz
>> K8-class
> CPU)
>> Origin = "GenuineIntel" Id = 0x106a5 Family = 6 Model = 1a
>> Stepping =
> 5
>>
> Features=
> 0xbfebfbff<
> FPU,
> VME,
> DE,
> PSE,
> TSC,
> MSR,
> PAE,
> MCE,
> CX8,
> APIC,
> SEP,
> MTRR,
> PGE,
> MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
>>
> Features2=
> 0x9ce3bd<
> SSE3,
> DTES64,
> MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,SSE4.2,POPCNT>
>> AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
>> AMD Features2=0x1<LAHF>
>> TSC: P-state invariant
>> real memory = 12884901888 (12288 MB)
>> avail memory = 12379992064 (11806 MB)
>> ACPI APIC Table: <091109 APIC2100>
>> FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
>> FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 SMT threads
>> cpu0 (BSP): APIC ID: 0
>> cpu1 (AP): APIC ID: 1
>> cpu2 (AP): APIC ID: 2
>> cpu3 (AP): APIC ID: 3
>> cpu4 (AP): APIC ID: 4
>> cpu5 (AP): APIC ID: 5
>> cpu6 (AP): APIC ID: 6
>> cpu7 (AP): APIC ID: 7
>>
>> [1] http://forums.freebsd.org/showthread.php?t=12527

Which means that because the support isn't there it'll need to be
added; I'll file a PR so this is tracked and see if I can provide a
patch for this.

Thanks!
-Garrett


------------------------------

Message: 11
Date: Mon, 22 Mar 2010 16:56:19 +0100
From: Joerg Sonnenberger <jo...@britannica.bec.de>
Subject: Re: nroff -man, .An Aq formatting
To: freebsd...@freebsd.org
Message-ID: <2010032215...@britannica.bec.de>
Content-Type: text/plain; charset=us-ascii

On Mon, Mar 22, 2010 at 03:05:52PM +0000, Christian Weisgerber wrote:
> And we probably have that usage in other man pages. It is not clear
> to me if the problem is the use of these characters for angle quotes
> or the use of .Aq for email addresses.

I think the best option would be to sit down and adjust .Mt slightly to
include the angle quotes and start to use that.

E.g. make
.Mt j...@example.com
output
<j...@example.com>

It is supported by (old) versions of groff already, just without the
angel quotes.

Joerg


------------------------------

Message: 12
Date: Mon, 22 Mar 2010 12:02:18 -0400
From: John Baldwin <j...@freebsd.org>
Subject: Re: [patch] teach the bootloader minor amd64 knowledge
To: Alexander Best <alexb...@wwu.de>
Cc: freebsd...@freebsd.org
Message-ID: <20100322120...@freebsd.org>
Content-Type: Text/Plain; charset="iso-8859-1"

On Monday 22 March 2010 11:20:10 am Alexander Best wrote:
> John Baldwin schrieb am 2010-03-22:
> > On Monday 22 March 2010 9:50:05 am Alexander Best wrote:
> > > hi there,
>
> > > since i386 and amd64 are sharing the same bootcode the bootloader
> > > gets named
> > > "FreeBSD/i386" on amd64 too. the following patch is a cosmetic
> > > change to
> > have
> > > the bootloader identify itself as "FreeBSD/amd64" on amd64.
>
> > > any thoughts on this one?
>
> > I would not do this. They really are the same binary. You can take
> > a
> > /boot/loader built under FreeBSD/i386 and use it to load an amd64
> > kernel and
> > vice versa. The one change I looked at doing a while back was
> > renaming the
> > i386/amd64 boot bits to identify themselves as 'FreeBSD/x86' rather
> > than
> > 'FreeBSD/i386'.
>
> sounds nice. however that would introduce some severe inconsistency, because
> the term 'i386' is used in many places to define the x86 architecture (uname
> -p/-m e.g.). also 'x86' related files/directories are called 'i386'.
>
> personally i'd like to see the term 'i386' completely replaced by 'x86'
> throughout the whole freebsd code.
>
> if i'm not mistaken 80386 has been dropped in GENERIC in freebsd4 and entirely
> in freebsd5.

Ah, but 'x86' is commonly used now for things that are shared between i386
and amd64. See sys/x86 in HEAD, sys/arch/x86 in NetBSD, etc. I think even
Linux has an x86 tree for shared code between i386 and x86_64.

--
John Baldwin


------------------------------

Message: 13
Date: Mon, 22 Mar 2010 17:34:44 +0100 (CET)
From: Alexander Best <alexb...@wwu.de>
Subject: Re: [patch] teach the bootloader minor amd64 knowledge
To: John Baldwin <j...@freebsd.org>
Cc: freebsd...@freebsd.org
Message-ID:
<permail-201003221634448...@message-id.uni-muenster.de>

Content-Type: text/plain; charset=us-ascii

John Baldwin schrieb am 2010-03-22:
> On Monday 22 March 2010 11:20:10 am Alexander Best wrote:
> > John Baldwin schrieb am 2010-03-22:
> > > On Monday 22 March 2010 9:50:05 am Alexander Best wrote:
> > > > hi there,

> > > > since i386 and amd64 are sharing the same bootcode the
> > > > bootloader
> > > > gets named
> > > > "FreeBSD/i386" on amd64 too. the following patch is a cosmetic
> > > > change to
> > > have
> > > > the bootloader identify itself as "FreeBSD/amd64" on amd64.

> > > > any thoughts on this one?

> > > I would not do this. They really are the same binary. You can
> > > take
> > > a
> > > /boot/loader built under FreeBSD/i386 and use it to load an amd64
> > > kernel and
> > > vice versa. The one change I looked at doing a while back was
> > > renaming the
> > > i386/amd64 boot bits to identify themselves as 'FreeBSD/x86'
> > > rather
> > > than
> > > 'FreeBSD/i386'.

> > sounds nice. however that would introduce some severe
> > inconsistency, because
> > the term 'i386' is used in many places to define the x86
> > architecture (uname
> > -p/-m e.g.). also 'x86' related files/directories are called
> > 'i386'.

> > personally i'd like to see the term 'i386' completely replaced by
> > 'x86'
> > throughout the whole freebsd code.

> > if i'm not mistaken 80386 has been dropped in GENERIC in freebsd4
> > and entirely
> > in freebsd5.

> Ah, but 'x86' is commonly used now for things that are shared between
> i386
> and amd64. See sys/x86 in HEAD, sys/arch/x86 in NetBSD, etc. I
> think even
> Linux has an x86 tree for shared code between i386 and x86_64.

i see. i always thought x86 was used to describe the intel 32 bit architecture
in general, replacing the term i386 (which describes a specific platform
rather than an architecture/instruction set).

introducing the x86 keyword sounds like a good idea. in the future it may not
only cover the intel 32bit and 64bit architecture, but also 128bit, etc. if
intel decides to keep the instruction set and remains backward compatible that
is. ;)

--
Alexander Best


------------------------------

Message: 14
Date: Mon, 22 Mar 2010 13:29:55 -0400
From: John Baldwin <j...@freebsd.org>
Subject: Re: [patch] somebody please fix this outstanding mmap(2) bug
To: freebsd...@freebsd.org
Cc: Alexander Best <alexb...@wwu.de>
Message-ID: <20100322132...@freebsd.org>
Content-Type: Text/Plain; charset="iso-8859-1"

On Monday 22 March 2010 11:07:43 am Alexander Best wrote:
> could somebody please commit this patch? it's been around forever (2003 or
> 2004) and fixes mmap so the offset argument is being ignored when MAP_ANON
is
> defined (just like the mmap(2) manual says). right now the offset argument
is
> being taken into account although MAP_ANON is set!!!
>
> the pr is kern/71258 (including a little c app to demonstrate the bug)
>
> i've also sent a followup patch to the pr which returns EINVAL if the offset
> is non zero and MAP_ANON is set, but i guess that might break some code.

I think we should go the EINVAL route, and I will commit the patch you did to
add that.

--
John Baldwin


------------------------------

Message: 15
Date: Mon, 22 Mar 2010 20:46:53 +0100 (CET)
From: Alexander Best <alexb...@wwu.de>
Subject: Re: [patch] somebody please fix this outstanding mmap(2) bug
To: John Baldwin <j...@freebsd.org>, <freebsd...@freebsd.org>
Message-ID:
<permail-201003221946531...@message-id.uni-muenster.de>

Content-Type: text/plain; charset=us-ascii

John Baldwin schrieb am 2010-03-22:
> On Monday 22 March 2010 11:07:43 am Alexander Best wrote:
> > could somebody please commit this patch? it's been around forever
> > (2003 or
> > 2004) and fixes mmap so the offset argument is being ignored when
> > MAP_ANON
> is
> > defined (just like the mmap(2) manual says). right now the offset
> > argument
> is
> > being taken into account although MAP_ANON is set!!!

> > the pr is kern/71258 (including a little c app to demonstrate the
> > bug)

> > i've also sent a followup patch to the pr which returns EINVAL if
> > the offset
> > is non zero and MAP_ANON is set, but i guess that might break some
> > code.

> I think we should go the EINVAL route, and I will commit the patch
> you did to
> add that.

thanks. :) i've checked what posix sais about this and since it doesn't know
MAP_ANON there's no real rule for this case. the only thing that comes close
is:

"The mmap() function may fail if:

[EINVAL]
The addr argument (if MAP_FIXED was specified) or off is not a multiple of the
page size as returned by sysconf(), or is considered invalid by the
implementation."

--
Alexander Best


------------------------------

Message: 16
Date: Mon, 22 Mar 2010 16:06:10 -0400
From: John Baldwin <j...@freebsd.org>
Subject: Re: [patch] somebody please fix this outstanding mmap(2) bug
To: Alexander Best <alexb...@wwu.de>
Cc: freebsd...@freebsd.org
Message-ID: <20100322160...@freebsd.org>
Content-Type: Text/Plain; charset="iso-8859-1"

On Monday 22 March 2010 3:46:53 pm Alexander Best wrote:
> John Baldwin schrieb am 2010-03-22:
> > On Monday 22 March 2010 11:07:43 am Alexander Best wrote:
> > > could somebody please commit this patch? it's been around forever
> > > (2003 or
> > > 2004) and fixes mmap so the offset argument is being ignored when
> > > MAP_ANON
> > is
> > > defined (just like the mmap(2) manual says). right now the offset
> > > argument
> > is
> > > being taken into account although MAP_ANON is set!!!
>
> > > the pr is kern/71258 (including a little c app to demonstrate the
> > > bug)
>
> > > i've also sent a followup patch to the pr which returns EINVAL if
> > > the offset
> > > is non zero and MAP_ANON is set, but i guess that might break some
> > > code.
>
> > I think we should go the EINVAL route, and I will commit the patch
> > you did to
> > add that.
>
> thanks. :) i've checked what posix sais about this and since it doesn't know
> MAP_ANON there's no real rule for this case. the only thing that comes close
> is:
>
> "The mmap() function may fail if:
>
> [EINVAL]
> The addr argument (if MAP_FIXED was specified) or off is not a multiple of the
> page size as returned by sysconf(), or is considered invalid by the
> implementation."

Yes, the 'considered invalid by the implementation' is the bit I'm claiming.

--
John Baldwin


------------------------------

Message: 17
Date: Mon, 22 Mar 2010 19:04:23 -0700
From: Garrett Cooper <yane...@gmail.com>
Subject: PR commit requests
To: FreeBSD-Hackers <freebsd...@freebsd.org>
Cc: lin...@freebsd.org
Message-ID:
<7d6fde3d1003221904o1e4...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi hackers,
Looking for someone with a src commit bit to take a look at a
number of items that Mark Linimon has marked as `easy PRs':
http://people.freebsd.org/~linimon/studies/prs/easy_prs.html . A lot
of the items there require that one just adds PCI IDs, fix a typo or
two, etc and are relatively trivial to commit.
It'd be much appreciated if folks could commit some of the items in this list.
Cheers!
-Garrett


------------------------------

Message: 18
Date: Tue, 23 Mar 2010 17:12:47 +1300 (NZDT)
From: Atom Smasher <at...@smasher.org>
Subject: kenv - output needed
To: FreeBSD-Hackers <freebsd...@freebsd.org>
Message-ID: <1003231706140.40436@smasher>
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

i'm trying to figure out what might be reasonable output from kenv. on the
three machines that i have access to i'm already seeing wide variations of
formatting and usefulness.

i'd like to collect as much output as i can get (off-list should be fine)
from one of these two commands:

1) preferred:
kenv | egrep bios

2) i can also use this:
kenv | egrep 'product|maker'

thanks!


--
...atom

________________________
http://atom.smasher.org/
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------

"Simply stated, there is no doubt that Saddam Hussein now
has weapons of mass destruction."
-- Dick Cheney, 26 August 2002

------------------------------

Message: 19
Date: Tue, 23 Mar 2010 08:36:47 +0100
From: Dominic Fandrey <kami...@bsdforen.de>
Subject: Re: nroff -man, .An Aq formatting
To: freebsd...@freebsd.org
Message-ID: <4BA86F8F...@bsdforen.de>
Content-Type: text/plain; charset=UTF-8

On 22/03/2010 16:05, Christian Weisgerber wrote:
> Dag-Erling Smørgrav <d...@des.no> wrote:
>
>>>> It has come to my attention that whereas with LANG=C "nroff -man"
>>>> formats ".An name Aq email" as "name <email>", it uses different
>>>> characters with LANG=en_GB.UTF-8 "name ⟨email⟩". These characters
>>>> are appropriate, but a lot of unicode fonts don't seem to have them.
>>
>> This is definitely a bug, since (as avg@ points out) you can no longer
>> copy-paste the name & address into an email client.
>>
>> AFAIK (judging from the Unicode group they're in) these characters are
>> intended mainly for writing things like <ENTER> and <CTRL>+<F1> in
>> technical documentation.
>
> And we probably have that usage in other man pages. It is not clear
> to me if the problem is the use of these characters for angle quotes
> or the use of .Aq for email addresses.

I got it out of the wpi(4) manual first. It probably appears in other
places, too.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


------------------------------

Message: 20
Date: Tue, 23 Mar 2010 08:38:22 +0100
From: Dominic Fandrey <kami...@bsdforen.de>
Subject: Re: nroff -man, .An Aq formatting
To: freebsd...@freebsd.org
Message-ID: <4BA86FEE...@bsdforen.de>
Content-Type: text/plain; charset=UTF-8

On 22/03/2010 02:20, Doug Barton wrote:
> On 03/21/10 01:24, Dominic Fandrey wrote:
>> It has come to my attention that whereas with LANG=C "nroff -man"
>> formats ".An name Aq email" as "name <email>", it uses different
>> characters with LANG=en_GB.UTF-8 "name ⟨email⟩". These characters
>> are appropriate, but a lot of unicode fonts don't seem to have them.
>>
>> Or else my terminal (rxvt-unicode) has trouble displaying them.
>>
>> Does anybody know a workaround for this?
>
> AFAIK our standard is -mdoc, not -man. Is there a specific purpose for
> which you need -man? And if not does the problem exist with -mdoc?

Ah, I didn't know that. Doesn't seem to make a difference, though.

Still, I'll test my pages with -mdoc instead of -man in the future.

Thanks a lot!

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


------------------------------

Message: 21
Date: Tue, 23 Mar 2010 12:18:24 +0300
From: Dmitry Krivenok <kriveno...@gmail.com>
Subject: Strange behavior of kernel module (output terminated)
To: freebsd...@freebsd.org
Message-ID:
<da48cf211003230218n567...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hello Hackers,

I'm new to FreeBSD kernel development and have a very basic question about
kernel modules.
I compiled and slightly modified an example from
http://www.freesoftwaremagazine.com/articles/writing_a_kernel_module_for_freebsd
.
Below is the source code of my first module called "hello":

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <sys/param.h>
#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/sched.h>
#include <sys/pcpu.h>

/* The function called at load/unload. */
static int event_handler(struct module *module, int event, void *arg)
{
int e = 0; /* Error, 0 for normal return status */
switch (event)
{
case MOD_LOAD:
uprintf("Hello FreeBSD kernel!\n");
int i = 0;
for(i = 0; i < 1000; i++)
{
uprintf("%3d ", i);
if(! (i % 10) ) uprintf("\n");
}
break;
case MOD_UNLOAD:
uprintf("Bye Bye FreeBSD Kernel!\n");
break;
default:
e = EOPNOTSUPP; /* Error, Operation Not Supported */
break;
}

return(e);
};

/* The second argument of DECLARE_MODULE. */
static moduledata_t hello_conf =
{
"hello", /* module name */
event_handler, /* event handler */
NULL /* extra data */
};

DECLARE_MODULE(hello, hello_conf, SI_SUB_KLD, SI_ORDER_ANY);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I compiled the module successfully and run it (via sudo make load unload).
The output confused me a bit:

$ uname -v
FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5 21:11:58 UTC 2010
ro...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC
$ make
Warning: Object directory not changed from original
/usr/home/krived/work/freebsd/hello
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc
-I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100
--param large-function-growth=1000 -fno-common -fno-omit-frame-pointer
-mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3
-mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables
-ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign
-fformat-extensions -c hello.c
ld -d -warn-common -r -d -o hello.ko hello.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk hello.ko export_syms | xargs -J% objcopy %
hello.ko
objcopy --strip-debug hello.ko
$ sudo make load unload
/sbin/kldload -v /usr/home/krived/work/freebsd/hello/hello.ko
Hello FreeBSD kernel!
0
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
101 102 103 104 105 106 107 108 109 110
111 112 113 114 115 116 117 118 119 120
121 122 123 124 125 126 127 128 129 130
131 132 133 134 135 136 137 138 139 140
141 142 143 144 145 146 147 148 149 150
151 152 153 154 155 156 157 158 159 160
161 162 163 164 165 166 167 168 169 170
171 172 173 174 175 176 177 178 179 180
181 182 183 184 185 186 187 188 189 190
191 192 193 194 195 196 197 198 199 200
201 202 203 204 205 206 207 208 209 210
211 212 213 214 215 216 217 218 219 220
221 222 223 224 225 226 227 228 229 230
231 232 233 234 235 236 237 238 239 240
241 242 243 244 245 246 247 248 249 250
251 252 253 254 255 256 257 258 259 260
261 262 263 264 265 266 267 268 269 270
271 272 273 274 275 276 277 278 279 280
281 282 283 284 285 286 287 288 289 290
291 292 293 294 295 296 297 298 299 300
301 302 303 304 305 306 307 308 309 310
311 312 313 314 315 316 317 318 319 320
321 322 323 324 325 326 327 328 329 330
331 332 333 334 335 336 337 338 339 340
341 342 343 344 345 346 347 348 349 350
351 352 353 354 355 356 357 358 359 360
361 362 363 364 365 366 367 368 369 370
371 372 373 374 375 376 377 378 379 380
381 382 383 384 385 386 387 388 389 390
391 392 393 394 395 396 397 398 399 400
401 402 403 404 405 406 407 408 409 410
411 412 413 414 415 416 417 418 419 420
421 422 423 424 425 426 427 428 429 430
431 432 433 434 435 436 437 438 439 440
441 442 443 444 445 446 447 448 449 450
451 452 453 454 455 456 457 458 459 460
461 462 463 464 465 466Loaded /usr/home/krived/work/freebsd/hello/hello.ko,
id=2
/sbin/kldunload -v hello.ko
Unloading hello.ko, id=2
Bye Bye FreeBSD Kernel!
$

As you can see the loop was terminated after i==466.
I tried to load/unload the module many times but the last printed number was
always 466.

Then I compiled the same module on FreeBSD-7.2 (note, the first test was run
on 8.0).
I saw exactly the same behavior except that the last number was always 550.

I don't think I found a bug in the kernel :)
I believe I just don't understand something.
Could you please explain the behavior of the module?

Thank you beforehand!

--
Sincerely yours, Dmitry V. Krivenok
e-mail: kriveno...@gmail.com
skype: krivenok_dmitry
jabber: kriveno...@jabber.ru
icq: 242-526-443


------------------------------

Message: 22
Date: Tue, 23 Mar 2010 12:22:47 +0100
From: Dag-Erling Sm?rgrav <d...@des.no>
Subject: Re: Strange behavior of kernel module (output terminated)
To: Dmitry Krivenok <kriveno...@gmail.com>
Cc: freebsd...@freebsd.org
Message-ID: <86ocifc...@ds4.des.no>
Content-Type: text/plain; charset=utf-8

Dmitry Krivenok <kriveno...@gmail.com> writes:
> /* The function called at load/unload. */
> static int event_handler(struct module *module, int event, void *arg)
> {
> int e = 0; /* Error, 0 for normal return status */
> switch (event)
> {
> case MOD_LOAD:
> uprintf("Hello FreeBSD kernel!\n");

I'm not sure it's such a good idea to use uprintf() here. The event
handler can be called in non-process context.

> int i = 0;
> for(i = 0; i < 1000; i++)
> {
> uprintf("%3d ", i);
> if(! (i % 10) ) uprintf("\n");
> }

(i % 10) is not a predicate. The test should be if (i % 10 == 0).

If you want to work on FreeBSD, I recommend you get used to the
FreeBSD coding style; see 'man 9 style'.

> As you can see the loop was terminated after i==466. I tried to
> load/unload the module many times but the last printed number was
> always 466.

You filled up a buffer somewhere...

DES
--
Dag-Erling Smørgrav - d...@des.no


------------------------------


End of freebsd-hackers Digest, Vol 365, Issue 2
***********************************************

0 new messages