Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-05 Thread Nick Hudson



On 05/01/2020 13:47, Izumi Tsutsui wrote:
[snip]


My patch allows COPTS to be overridden as


http://src.illumos.org/source/xref/netbsd-src/sys/conf/Makefile.kern.inc#69

has

69 DEFCOPTS?=   -O2
70 COPTS?=  ${DEFCOPTS}

which I believe allows COPTS to be overridden by

makeoptions COPTS="..."


If it's users' responsibility to explicitly add "-mapcs-frame" in COPTS
when they want to build a kernel with both COPTS="-Os" and options DDB,
it's okay for me.  (I'm afraid zaurus GENERIC needs -Os in near future)


I changed the use of COPTS to CFLAGS - hopefully this fixes all problems.

Sorry for the breakage.

Nick


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-05 Thread Izumi Tsutsui
> >> I don't see how as sys/arch/zaurus/conf/INSTALL doesn't define DDB.
> >
> > On zaurus GENERIC also has a size restriction (due to bootloader).
> 
> Yes, I understand that. What I don't understand is how my
> sys/arch/arm/conf/Makefile.arm change affects the zaurus INSTALL kernel
> size because INSTALL specifically disables DDB and my patch is
> conditional on DDB

As martin wrote, the problem is not INSTALL but GENERIC
because zaurus GENERIC is large (~5MB) enough.

> My patch allows COPTS to be overridden as
> 
> 
> http://src.illumos.org/source/xref/netbsd-src/sys/conf/Makefile.kern.inc#69
> 
> has
> 
> 69 DEFCOPTS?= -O2
> 70 COPTS?=${DEFCOPTS}
> 
> which I believe allows COPTS to be overridden by
> 
> makeoptions COPTS="..."

If it's users' responsibility to explicitly add "-mapcs-frame" in COPTS 
when they want to build a kernel with both COPTS="-Os" and options DDB,
it's okay for me.  (I'm afraid zaurus GENERIC needs -Os in near future)

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-05 Thread Nick Hudson

On 05/01/2020 13:31, Martin Husemann wrote:

On Sun, Jan 05, 2020 at 01:21:46PM +, Nick Hudson wrote:

Yes, I understand that. What I don't understand is how my
sys/arch/arm/conf/Makefile.arm change affects the zaurus INSTALL kernel
size because INSTALL specifically disables DDB and my patch is
conditional on DDB


It did only break GENERIC in the releng builds (AFAICT).


Ah, my bad.

Nick




Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-05 Thread Martin Husemann
On Sun, Jan 05, 2020 at 01:21:46PM +, Nick Hudson wrote:
> Yes, I understand that. What I don't understand is how my
> sys/arch/arm/conf/Makefile.arm change affects the zaurus INSTALL kernel
> size because INSTALL specifically disables DDB and my patch is
> conditional on DDB

It did only break GENERIC in the releng builds (AFAICT).

Martin


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-05 Thread Nick Hudson




On 04/01/2020 16:32, Izumi Tsutsui wrote:

The problem is caused by sys/arch/arm/conf/Makefile.arm.
It defines "COPTS+= -mapcs-frame" in recent rev 1.52
   
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/conf/Makefile.arm#rev1.52
but MI sys/conf/Makefile.kern.inc defines COPTS+=-O2
only if COPTS is empty.


I don't see how as sys/arch/zaurus/conf/INSTALL doesn't define DDB.


On zaurus GENERIC also has a size restriction (due to bootloader).


Yes, I understand that. What I don't understand is how my
sys/arch/arm/conf/Makefile.arm change affects the zaurus INSTALL kernel
size because INSTALL specifically disables DDB and my patch is
conditional on DDB





This affects not only zaurus but all arm ports?


Maybe this patch is better?


I wonder if it will work as expected if COPTS+="-Os" is
already specified with options DDB, if -mapcs-frame
is mandatory for DDB. But if -fno-omit-frame-pointer
in Makefile.amd64 may have the similar problem,
it's also okay for arm, IMO.

Maybe it's less probematic to add a new option (COPTS_MD etc.)
and add it to COPTS after including Makefile.kern.inc,
i.e. in "(11) Appending make options." in Makefile.arm?


My patch allows COPTS to be overridden as


http://src.illumos.org/source/xref/netbsd-src/sys/conf/Makefile.kern.inc#69

has

69 DEFCOPTS?=   -O2
70 COPTS?=  ${DEFCOPTS}

which I believe allows COPTS to be overridden by

makeoptions COPTS="..."

Nick


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-04 Thread Izumi Tsutsui
> > The problem is caused by sys/arch/arm/conf/Makefile.arm.
> > It defines "COPTS+= -mapcs-frame" in recent rev 1.52
> >   
> > http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/conf/Makefile.arm#rev1.52
> > but MI sys/conf/Makefile.kern.inc defines COPTS+=-O2
> > only if COPTS is empty.
> 
> I don't see how as sys/arch/zaurus/conf/INSTALL doesn't define DDB.

On zaurus GENERIC also has a size restriction (due to bootloader).

> > This affects not only zaurus but all arm ports?
> 
> Maybe this patch is better?

I wonder if it will work as expected if COPTS+="-Os" is
already specified with options DDB, if -mapcs-frame
is mandatory for DDB. But if -fno-omit-frame-pointer
in Makefile.amd64 may have the similar problem,
it's also okay for arm, IMO.

Maybe it's less probematic to add a new option (COPTS_MD etc.)
and add it to COPTS after including Makefile.kern.inc,
i.e. in "(11) Appending make options." in Makefile.arm?

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-04 Thread Nick Hudson



On 03/01/2020 18:42, Izumi Tsutsui wrote:

I wrote:

The missing COPTS was an accident or fallout from some other changes?


Isn't it specified in -current?


The problem is caused by sys/arch/arm/conf/Makefile.arm.
It defines "COPTS+= -mapcs-frame" in recent rev 1.52
  http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/conf/Makefile.arm#rev1.52
but MI sys/conf/Makefile.kern.inc defines COPTS+=-O2
only if COPTS is empty.


I don't see how as sys/arch/zaurus/conf/INSTALL doesn't define DDB.


This affects not only zaurus but all arm ports?


Maybe this patch is better?

Nick
Index: sys/arch/arm/conf/Makefile.arm
===
RCS file: /cvsroot/src/sys/arch/arm/conf/Makefile.arm,v
retrieving revision 1.52
diff -u -p -r1.52 Makefile.arm
--- sys/arch/arm/conf/Makefile.arm  2 Jan 2020 14:33:55 -   1.52
+++ sys/arch/arm/conf/Makefile.arm  4 Jan 2020 15:02:40 -
@@ -78,7 +78,7 @@ CFLAGS+=  -mno-unaligned-access
 
 OPT_DDB=   %DDB%
 .if !empty(OPT_DDB) && ${HAVE_GCC:U0} > 0
-COPTS+=-mapcs-frame
+DEFCOPTS=  -O2 -mapcs-frame
 .endif
 
 ##


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Martin Husemann
On Sat, Jan 04, 2020 at 03:42:20AM +0900, Izumi Tsutsui wrote:
> The problem is caused by sys/arch/arm/conf/Makefile.arm.
> It defines "COPTS+= -mapcs-frame" in recent rev 1.52
>  
> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/conf/Makefile.arm#rev1.52
> but MI sys/conf/Makefile.kern.inc defines COPTS+=-O2
> only if COPTS is empty.
>  
> This affects not only zaurus but all arm ports?

Yes! But only zaurus caused a build failure due to it.

> ---
> Index: sys/arch/arm/conf/Makefile.arm
> ===
> RCS file: /cvsroot/src/sys/arch/arm/conf/Makefile.arm,v
> retrieving revision 1.52
> diff -u -p -d -r1.52 Makefile.arm
> --- sys/arch/arm/conf/Makefile.arm2 Jan 2020 14:33:55 -   1.52
> +++ sys/arch/arm/conf/Makefile.arm3 Jan 2020 18:35:36 -
> @@ -78,7 +78,7 @@ CFLAGS+=-mno-unaligned-access
>  
>  OPT_DDB= %DDB%
>  .if !empty(OPT_DDB) && ${HAVE_GCC:U0} > 0
> -COPTS+=  -mapcs-frame
> +CFLAGS+= -mapcs-frame
>  .endif
>  
>  ##

I wonder if we should make the handling in sys/conf/Makefile.kern.inc
"better" and avoid this dance. If anyone fixes it, please feel free to
back out my bandaid in sys/arch/zaurus/conf/Makefile.zaurus.

Martin


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Izumi Tsutsui
I wrote:
> > The missing COPTS was an accident or fallout from some other changes?
> 
> Isn't it specified in -current?

The problem is caused by sys/arch/arm/conf/Makefile.arm.
It defines "COPTS+= -mapcs-frame" in recent rev 1.52
 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/arm/conf/Makefile.arm#rev1.52
but MI sys/conf/Makefile.kern.inc defines COPTS+=-O2
only if COPTS is empty.
 
This affects not only zaurus but all arm ports?

---
Index: sys/arch/arm/conf/Makefile.arm
===
RCS file: /cvsroot/src/sys/arch/arm/conf/Makefile.arm,v
retrieving revision 1.52
diff -u -p -d -r1.52 Makefile.arm
--- sys/arch/arm/conf/Makefile.arm  2 Jan 2020 14:33:55 -   1.52
+++ sys/arch/arm/conf/Makefile.arm  3 Jan 2020 18:35:36 -
@@ -78,7 +78,7 @@ CFLAGS+=  -mno-unaligned-access
 
 OPT_DDB=   %DDB%
 .if !empty(OPT_DDB) && ${HAVE_GCC:U0} > 0
-COPTS+=-mapcs-frame
+CFLAGS+=   -mapcs-frame
 .endif
 
 ##

---
Izumi Tsutsui
 


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Izumi Tsutsui
> > - zbsdmod.o has 5MB buffers to store a copied kernel binary
> > - zbsdmod.o reads a kernel from the 5MB buffer and loads sections
> >   into the target addresses
> >  
> > https://nxr.netbsd.org/xref/src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c?r=1.12#94
> 
> Ah ok - thanks for explanation. So the dropping of ctf sections makes sense.

Yes.

> The missing COPTS was an accident or fallout from some other changes?

Isn't it specified in -current?
I think -O2 comes from MI src/sys/conf/Makefile.kern.inc:
 https://nxr.netbsd.org/xref/src/sys/conf/Makefile.kern.inc?r=1.268#69

On netbsd-9, GENERIC build uses -O2:
---
% /s/netbsd-9/src/obj.zaurus/tooldir.NetBSD-9.0_RC1-i386/bin/nbmake-zaurus 
init_main.o
#   compile  GENERIC/init_main.o
/s/netbsd-9/src/obj.zaurus/tooldir.NetBSD-9.0_RC1-i386/bin/arm--netbsdelf-eabi-gcc
 -mfloat-abi=soft -ffreestanding -fno-zero-initialized-in-bss 
-fno-delete-null-pointer-checks -O2 -msoft-float -fno-strict-aliasing 
-fno-common -std=gnu99 -Werror -Wall -Wno-main -Wno-format-zero-length 
-Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition 
-Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code 
-Wno-pointer-sign -Wno-attributes -Wno-sign-compare -mcpu=xscale 
--sysroot=/s/netbsd-9/src/obj.zaurus/destdir.zaurus -Dzaurus -I. 
-I../../../../external/bsd/libnv/dist -I../../../../../common/lib/libx86emu 
-I../../../../../common/lib/libc/misc -I../../../../../common/include 
-I../../../../arch -I../../../.. -nostdinc -DCOMPAT_UTILS -DCOMPAT_44 
-DDIAGNOSTIC -DW100_LCD_WRITETHROUGH -D_KERNEL -D_KERNEL_OPT -std=gnu99 
-I../../../../lib/libkern/../../../common/lib/libc/quad 
-I../../../../lib/libkern/../../../common/lib/libc/string 
-I../../../../lib/libker!
 n/../../../common/lib/libc/arch/arm/string -c ../../../../kern/init_main.c -o 
init_main.o
/s/netbsd-9/src/obj.zaurus/tooldir.NetBSD-9.0_RC1-i386/bin/nbctfconvert -g -L 
VERSION init_main.o
---

zaurus/conf/INSTALL has COPTS="-Os" in its config, though.

---
Izumi Tsutsui


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Martin Husemann
On Fri, Jan 03, 2020 at 07:36:34PM +0900, Izumi Tsutsui wrote:
> - zbsdmod.o has 5MB buffers to store a copied kernel binary
> - zbsdmod.o reads a kernel from the 5MB buffer and loads sections
>   into the target addresses
>  
> https://nxr.netbsd.org/xref/src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c?r=1.12#94

Ah ok - thanks for explanation. So the dropping of ctf sections makes sense.

The missing COPTS was an accident or fallout from some other changes?

Martin


Re: CVS commit: src/sys/arch/zaurus/conf

2020-01-03 Thread Izumi Tsutsui
martin@ wrote:

> Module Name:  src
> Committed By: martin
> Date: Fri Jan  3 10:01:07 UTC 2020
> 
> Modified Files:
>   src/sys/arch/zaurus/conf: Makefile.zaurus.inc ldscript.zaurus
> 
> Log Message:
> Drop CTF sections from this size restricted kernel (especially as the
> size check is on the total size of the binary, not any content/sections -
> is this a bug?)

No, it (checking the total size of the binary) is by design.

- a kernel binary is loaded by a Linux kernel module (named zbsdmod.o)
  on the native Zaurus Linux
- to load a NetBSD kernel, the whole binary is copied into /proc/zboot
  node, created by the zbsdmod.o module
- zbsdmod.o has 5MB buffers to store a copied kernel binary
- zbsdmod.o reads a kernel from the 5MB buffer and loads sections
  into the target addresses
 
https://nxr.netbsd.org/xref/src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c?r=1.12#94

---
Izumi Tsutsui


CVS commit: src/sys/arch/zaurus/conf

2019-11-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 23:13:00 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
Put back options WSDISPLAY_COMPAT_RAWKBD. It's required by Xorg server.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/zaurus/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.87 src/sys/arch/zaurus/conf/GENERIC:1.88
--- src/sys/arch/zaurus/conf/GENERIC:1.87	Wed Aug 21 04:17:41 2019
+++ src/sys/arch/zaurus/conf/GENERIC	Sat Nov  2 23:13:00 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.87 2019/08/21 04:17:41 msaitoh Exp $
+#	$NetBSD: GENERIC,v 1.88 2019/11/02 23:13:00 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -143,7 +143,7 @@ options 	WS_KERNEL_FG=WSCOL_GREEN
 # compatibility to other console drivers
 options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-# options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
+options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
 
 # Development and Debugging options
 



CVS commit: src/sys/arch/zaurus/conf

2019-11-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  2 23:13:00 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
Put back options WSDISPLAY_COMPAT_RAWKBD. It's required by Xorg server.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/zaurus/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/zaurus/conf

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:49:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: Makefile.zaurus.inc

Log Message:
Explicitly set empty LINKENTRY to keep ENTRY address specified in ldscript.

This fixes kernel boot failures of NetBSD/zaurus 8.x and later.
While here, also set empty TEXTADDR also specified in ldscript.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/conf/Makefile.zaurus.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/zaurus/conf/Makefile.zaurus.inc
diff -u src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.9 src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.10
--- src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.9	Tue Aug 25 02:38:15 2015
+++ src/sys/arch/zaurus/conf/Makefile.zaurus.inc	Sat Oct 26 09:49:13 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.zaurus.inc,v 1.9 2015/08/25 02:38:15 uebayasi Exp $
+#	$NetBSD: Makefile.zaurus.inc,v 1.10 2019/10/26 09:49:13 tsutsui Exp $
 
 MACHINE_ARCH?=		arm
 CPPFLAGS+=		-D${MACHINE}
@@ -20,6 +20,8 @@ SYSTEM_LD_TAIL_EXTRA+=; \
 KERNEL_BASE_VIRT=	$(LOADADDRESS)
 
 KERNLDSCRIPT=		ldscript
+TEXTADDR=		# defined in ldscript
+LINKENTRY=		# defined in ldscript
 
 EXTRA_CLEAN+=		netbsd.map assym.d ldscript tmp
 



CVS commit: src/sys/arch/zaurus/conf

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:49:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: Makefile.zaurus.inc

Log Message:
Explicitly set empty LINKENTRY to keep ENTRY address specified in ldscript.

This fixes kernel boot failures of NetBSD/zaurus 8.x and later.
While here, also set empty TEXTADDR also specified in ldscript.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/conf/Makefile.zaurus.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/zaurus/conf

2019-07-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jul 26 07:09:48 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
comment out WSDISPLAY_COMPAT_RAWKBD for now, it does not compile


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/zaurus/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/zaurus/conf

2019-07-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jul 26 07:09:48 UTC 2019

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
comment out WSDISPLAY_COMPAT_RAWKBD for now, it does not compile


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/zaurus/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.85 src/sys/arch/zaurus/conf/GENERIC:1.86
--- src/sys/arch/zaurus/conf/GENERIC:1.85	Fri Mar 29 21:06:51 2019
+++ src/sys/arch/zaurus/conf/GENERIC	Fri Jul 26 07:09:47 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.85 2019/03/29 21:06:51 christos Exp $
+#	$NetBSD: GENERIC,v 1.86 2019/07/26 07:09:47 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -143,7 +143,7 @@ options 	WS_KERNEL_FG=WSCOL_GREEN
 # compatibility to other console drivers
 options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
+# options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
 
 # Development and Debugging options
 



Re: CVS commit: src/sys/arch/zaurus/conf

2015-07-19 Thread Martin Husemann
I backed it out, will try to fix differently.

Martin


Re: CVS commit: src/sys/arch/zaurus/conf

2015-07-17 Thread Izumi Tsutsui
martin@ wrote:

> Module Name:  src
> Committed By: martin
> Date: Fri Jul 17 19:32:24 UTC 2015
> 
> Modified Files:
>   src/sys/arch/zaurus/conf: INSTALL
> 
> Log Message:
> Provide a bit more space for the ram disk image

Did you check the following comment in INSTALL?

>> # for reduce kernel size.
>> # kernel size must be less than 5MB.
>> # - see src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:bsdimage[]

---
Izumi Tsutsui