Re: gc the unp_gcing flag

2016-02-25 Thread Philip Guenther
On Thu, Feb 25, 2016 at 3:42 AM, David Gwynne  wrote:
> the gc is run from a task in the systq, so we dont need a flag to
> serialise it. it is already serialised.
>
> ok?

I have a TODO entry saying "instead of triggering the unp_gc task, set
a per-thread flag and then do the unp_gc call before returning to
userspace; still need unp_gc task for process/thread exit case?"

The idea is that if my process closing an fd is responsible for
creating unp garbage, it should do the collection and get charged for
the kernel time instead of pushing that work to the system.


Philip Guenther



Re: match /etc/examples/printcap with spool directory in lpr/common_source/pathnames.h

2016-02-25 Thread Chris Bennett
On Thu, Feb 25, 2016 at 07:56:54PM -0700, Theo de Raadt wrote:
> Chris, you continue to amaze me.
> 
> Upon running sysmerge, that will break everyone's setup.
> 
> Like, can you try stuff before you send it out?
> 
> I'm done.
> 

Sorry. It was my misunderstanding that files in /etc/examples were
optional and did not receive the same treatment as mandatory files such
as /etc/hosts.
I did not think that this was an item that needed to be tested, since
this was merely an example of how a configuration file could be started
and details found in the manual pages.

I will just have to make more mistakes and be corrected until I get it
right.

I will look deeper into sysmerge, hopefully with some help to properly
resolve this problem.

Chris



Re: match /etc/examples/printcap with spool directory in lpr/common_source/pathnames.h

2016-02-25 Thread Theo de Raadt
Chris, you continue to amaze me.

Upon running sysmerge, that will break everyone's setup.

Like, can you try stuff before you send it out?

I'm done.

> /etc/examples/printcap doesn't match
> #define   _PATH_DEFSPOOL  "/var/spool/output/lpd"
> 
> Which seems sensible to keep lpd jobs out of output directory
> 
> Index: printcap
> ===
> RCS file: /cvs/src/etc/examples/printcap,v
> retrieving revision 1.1
> diff -u -p -r1.1 printcap
> --- printcap  12 Jul 2014 03:52:39 -  1.1
> +++ printcap  25 Feb 2016 20:53:56 -
> @@ -1,7 +1,7 @@
>  #$OpenBSD: printcap,v 1.1 2014/07/12 03:52:39 deraadt Exp $
>  
>  #lp|local line printer:\
> -#:lp=/dev/lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
> +#:lp=/dev/lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
>  
>  #rp|remote line printer:\
> -#:lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
> +#:lp=:rm=printhost:rp=lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
> 
> OK?
> 
> Chris
> 



match /etc/examples/printcap with spool directory in lpr/common_source/pathnames.h

2016-02-25 Thread Chris Bennett
/etc/examples/printcap doesn't match
#define _PATH_DEFSPOOL  "/var/spool/output/lpd"

Which seems sensible to keep lpd jobs out of output directory

Index: printcap
===
RCS file: /cvs/src/etc/examples/printcap,v
retrieving revision 1.1
diff -u -p -r1.1 printcap
--- printcap12 Jul 2014 03:52:39 -  1.1
+++ printcap25 Feb 2016 20:53:56 -
@@ -1,7 +1,7 @@
 #  $OpenBSD: printcap,v 1.1 2014/07/12 03:52:39 deraadt Exp $
 
 #lp|local line printer:\
-#  :lp=/dev/lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
+#  :lp=/dev/lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
 
 #rp|remote line printer:\
-#  :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
+#  :lp=:rm=printhost:rp=lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:

OK?

Chris



stale entries for RAIDframe in chrtoblktbl

2016-02-25 Thread Martin Natano
For most architectures there still is an entry for the removed RAIDframe
device lurking in chrtoblktbl. While there I truncated the tables to the
minimum required size; chrtoblk() and blktochr() are designed to handle
a table shorter than cdevsw.

Ok?

natano


Index: arch/alpha/alpha/conf.c
===
RCS file: /cvs/src/sys/arch/alpha/alpha/conf.c,v
retrieving revision 1.79
diff -u -p -r1.79 conf.c
--- arch/alpha/alpha/conf.c 23 Oct 2015 15:10:52 -  1.79
+++ arch/alpha/alpha/conf.c 25 Feb 2016 22:33:57 -
@@ -285,19 +285,5 @@ int chrtoblktbl[] = {
/* 35 */NODEV,
/* 36 */0,
/* 37 */4,  /* fd */
-   /* 38 */NODEV,
-   /* 39 */NODEV,
-   /* 40 */NODEV,
-   /* 41 */NODEV,
-   /* 42 */NODEV,
-   /* 43 */16, /* raid */
-   /* 44 */NODEV,
-   /* 45 */NODEV,
-   /* 46 */NODEV,
-   /* 47 */NODEV,
-   /* 48 */NODEV,
-   /* 49 */NODEV,
-   /* 50 */NODEV,
-   /* 51 */NODEV,
 };
 int nchrtoblktbl = nitems(chrtoblktbl);
Index: arch/amd64/amd64/conf.c
===
RCS file: /cvs/src/sys/arch/amd64/amd64/conf.c,v
retrieving revision 1.56
diff -u -p -r1.56 conf.c
--- arch/amd64/amd64/conf.c 5 Feb 2016 06:29:01 -   1.56
+++ arch/amd64/amd64/conf.c 25 Feb 2016 22:33:57 -
@@ -388,13 +388,6 @@ int chrtoblktbl[] = {
/* 45 */NODEV,
/* 46 */NODEV,
/* 47 */17, /* rd */
-   /* 48 */NODEV,
-   /* 49 */NODEV,
-   /* 50 */NODEV,
-   /* 51 */NODEV,
-   /* 52 */NODEV,
-   /* 53 */NODEV,
-   /* 54 */19, /* raid */
 };
 
 int nchrtoblktbl = nitems(chrtoblktbl);
Index: arch/arm/arm/conf.c
===
RCS file: /cvs/src/sys/arch/arm/arm/conf.c,v
retrieving revision 1.42
diff -u -p -r1.42 conf.c
--- arch/arm/arm/conf.c 23 Oct 2015 15:10:52 -  1.42
+++ arch/arm/arm/conf.c 25 Feb 2016 22:33:57 -
@@ -450,51 +450,6 @@ int chrtoblktbl[] = {
 /* 24 */24,/* sd */
 /* 25 */25,/* st */
 /* 26 */26,/* cd */
-/* 27 */NODEV,
-/* 28 */NODEV,
-/* 29 */NODEV,
-/* 30 */NODEV,
-/* 31 */NODEV,
-/* 32 */NODEV,
-/* 33 */NODEV,
-/* 34 */NODEV,
-/* 35 */NODEV,
-/* 36 */NODEV,
-/* 37 */NODEV,
-/* 38 */NODEV,
-/* 39 */NODEV,
-/* 40 */NODEV,
-/* 41 */NODEV,
-/* 42 */NODEV,
-/* 43 */NODEV,
-/* 44 */NODEV,
-/* 45 */NODEV,
-/* 46 */NODEV,
-/* 47 */NODEV,
-/* 48 */NODEV,
-/* 49 */NODEV,
-/* 50 */NODEV,
-/* 51 */NODEV,
-/* 52 */NODEV,
-/* 53 */NODEV,
-/* 54 */NODEV,
-/* 55 */NODEV,
-/* 56 */   NODEV,
-/* 57 */   NODEV,
-/* 58 */   NODEV,
-/* 59 */NODEV,
-/* 60 */NODEV,
-/* 61 */NODEV,
-/* 62 */NODEV,
-/* 63 */NODEV,
-/* 64 */NODEV,
-/* 65 */NODEV,
-/* 66 */   NODEV,
-/* 67 */   NODEV,
-/* 68 */   NODEV,
-/* 69 */   NODEV,
-/* 70 */   NODEV,
-/* 71 */   71, /* raid */
 };
 int nchrtoblktbl = nitems(chrtoblktbl);
 
Index: arch/i386/i386/conf.c
===
RCS file: /cvs/src/sys/arch/i386/i386/conf.c,v
retrieving revision 1.153
diff -u -p -r1.153 conf.c
--- arch/i386/i386/conf.c   5 Feb 2016 06:29:01 -   1.153
+++ arch/i386/i386/conf.c   25 Feb 2016 22:33:58 -
@@ -380,13 +380,6 @@ int chrtoblktbl[] = {
/* 45 */NODEV,
/* 46 */NODEV,
/* 47 */17, /* rd */
-   /* 48 */NODEV,
-   /* 49 */NODEV,
-   /* 50 */NODEV,
-   /* 51 */NODEV,
-   /* 52 */NODEV,
-   /* 53 */NODEV,
-   /* 54 */19, /* raid */
 };
 int nchrtoblktbl = nitems(chrtoblktbl);
 
Index: arch/landisk/landisk/conf.c
===
RCS file: /cvs/src/sys/arch/landisk/landisk/conf.c,v
retrieving revision 1.32
diff -u -p -r1.32 conf.c
--- arch/landisk/landisk/conf.c 23 Oct 2015 15:10:52 -  1.32
+++ arch/landisk/landisk/conf.c 25 Feb 2016 22:33:59 -
@@ -426,51 +426,6 @@ int chrtoblktbl[] = {
 /* 24 */24,/* s

Re: rtadvd: remove more dead code

2016-02-25 Thread Jérémie Courrèges-Anglas
j...@wxcvbn.org (Jérémie Courrèges-Anglas) writes:

> - a few *cnt members of struct rainfo aren't used for anything
> - the SIOCGIFPREFIX_IN6 ioctl has been deprecated since June 2002
> - prefix_match() and in6a_site_allrouters are remnants from the
>   Renumbering code (now in the Attic)
>
> ok?

ping

> Index: config.c
> ===
> RCS file: /cvs/src/usr.sbin/rtadvd/config.c,v
> retrieving revision 1.50
> diff -u -p -r1.50 config.c
> --- config.c  9 Feb 2016 00:39:13 -   1.50
> +++ config.c  9 Feb 2016 00:54:13 -
> @@ -323,7 +323,6 @@ getconfig(char *intface)
>   if (tmp->pfxs == 0 && !agetflag("noifprefix"))
>   get_prefix(tmp);
>  
> - tmp->rtinfocnt = 0;
>   for (i = -1; i < MAXRTINFO; i++) {
>   struct rtinfo *rti;
>   char entbuf[256];
> @@ -391,10 +390,8 @@ getconfig(char *intface)
>   rti->lifetime = (uint32_t)val64;
>  
>   TAILQ_INSERT_TAIL(&tmp->rtinfos, rti, entry);
> - tmp->rtinfocnt++;
>   }
>  
> - tmp->rdnsscnt = 0;
>   for (i = -1; i < MAXRDNSS; ++i) {
>   struct rdnss *rds;
>   char entbuf[256];
> @@ -417,7 +414,6 @@ getconfig(char *intface)
>   fatal("malloc");
>  
>   TAILQ_INSERT_TAIL(&tmp->rdnsss, rds, entry);
> - tmp->rdnsscnt++;
>  
>   rds->servercnt = val;
>  
> @@ -441,7 +437,6 @@ getconfig(char *intface)
>   }
>   }
>  
> - tmp->dnsslcnt = 0;
>   for (i = -1; i < MAXDNSSL; ++i) {
>   struct dnssl *dsl;
>   char entbuf[256];
> @@ -481,7 +476,6 @@ getconfig(char *intface)
>   }
>  
>   TAILQ_INSERT_TAIL(&tmp->dnssls, dsl, entry);
> - tmp->dnsslcnt++;
>  
>   makeentry(entbuf, sizeof(entbuf), i, "dnsslltime");
>   MAYHAVE(val, entbuf, (tmp->maxinterval * 3) / 2);
> @@ -692,44 +686,11 @@ delete_prefix(struct rainfo *rai, struct
>  static int
>  init_prefix(struct in6_prefixreq *ipr)
>  {
> -#if 0
> - int s;
> -
> - if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
> - log_warn("socket");
> - exit(1);
> - }
> -
> - if (ioctl(s, SIOCGIFPREFIX_IN6, (caddr_t)ipr) < 0) {
> - log_warn("ioctl:SIOCGIFFLAGS: failed for %s", ifr.ifr_name);
> -
> - ipr->ipr_vltime = DEF_ADVVALIDLIFETIME;
> - ipr->ipr_pltime = DEF_ADVPREFERREDLIFETIME;
> - ipr->ipr_raf_onlink = 1;
> - ipr->ipr_raf_auto = 1;
> - /* omit other field initialization */
> - }
> - else if (ipr->ipr_origin < PR_ORIG_RR) {
> - u_char ntopbuf[INET6_ADDRSTRLEN];
> -
> - log_warn("Added prefix(%s)'s origin %d is"
> - " lower than PR_ORIG_RR(router renumbering)."
> - " This should not happen if I am router",
> - inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf,
> - sizeof(ntopbuf)), ipr->ipr_origin);
> - close(s);
> - return 1;
> - }
> -
> - close(s);
> - return 0;
> -#else
>   ipr->ipr_vltime = DEF_ADVVALIDLIFETIME;
>   ipr->ipr_pltime = DEF_ADVPREFERREDLIFETIME;
>   ipr->ipr_raf_onlink = 1;
>   ipr->ipr_raf_auto = 1;
>   return 0;
> -#endif
>  }
>  
>  void
> Index: rtadvd.c
> ===
> RCS file: /cvs/src/usr.sbin/rtadvd/rtadvd.c,v
> retrieving revision 1.68
> diff -u -p -r1.68 rtadvd.c
> --- rtadvd.c  9 Feb 2016 00:40:00 -   1.68
> +++ rtadvd.c  9 Feb 2016 00:54:13 -
> @@ -1009,30 +1009,6 @@ find_prefix(struct rainfo *rai, struct i
>   return(NULL);
>  }
>  
> -/* check if p0/plen0 matches p1/plen1; return 1 if matches, otherwise 0. */
> -int
> -prefix_match(struct in6_addr *p0, int plen0,
> -  struct in6_addr *p1, int plen1)
> -{
> - int bytelen, bitlen;
> - u_char bitmask;
> -
> - if (plen0 < plen1)
> - return(0);
> - bytelen = plen1 / 8;
> - bitlen = plen1 % 8;
> - bitmask = 0xff << (8 - bitlen);
> - if (memcmp((void *)p0, (void *)p1, bytelen))
> - return(0);
> - if (bitlen == 0 ||
> - ((p0->s6_addr[bytelen] & bitmask) ==
> -  (p1->s6_addr[bytelen] & bitmask))) {
> - return(1);
> - }
> -
> - return(0);
> -}
> -
>  static int
>  nd6_options(struct nd_opt_hdr *hdr, int limit,
>   union nd_opts *ndopts, u_int32_t optflags)
> Index: rtadvd.h
> ===
> RCS file: /cvs/src/usr.sbin/rtadvd/rtadvd.h,v
> retrieving revision 1.21
> diff -u -p -r1.21 rtadvd.h
> --- rtadvd.h  9 Feb 2016 00:39:13 -   1.21
> +++ rtadvd.h  9 Feb 2016 00:54:13 -
> @@ -148,11 +148,8 @@ struct   rainfo {
>   TAILQ_HEAD(prefixlist, prefix) prefixes; /* AdvPrefixList(link head) */
>   int   

Re: x86 callframe definitions

2016-02-25 Thread Mike Larkin
On Thu, Feb 25, 2016 at 03:10:54PM +0100, Martin Pieuchot wrote:
> This rename and move the i386 and amd64 ``callframe'' structures in order
> to use it in MI code.  My goal is to unify our architectures to be able
> to retrieve the PC of the calling function with as little MD code as
> possible.
> 
> There's no functional change in this diff.  ok?

This reads ok to me. ok mlarkin@

> 
> Index: amd64/amd64/db_trace.c
> ===
> RCS file: /cvs/src/sys/arch/amd64/amd64/db_trace.c,v
> retrieving revision 1.13
> diff -u -p -r1.13 db_trace.c
> --- amd64/amd64/db_trace.c28 Jun 2015 01:16:28 -  1.13
> +++ amd64/amd64/db_trace.c25 Feb 2016 14:06:10 -
> @@ -100,12 +100,6 @@ db_x86_64_regop(struct db_variable *vp, 
>   */
>  #define  INKERNEL(va)(((vaddr_t)(va)) >= VM_MIN_KERNEL_ADDRESS)
>  
> -struct x86_64_frame {
> - struct x86_64_frame *f_frame;
> - longf_retaddr;
> - longf_arg0;
> -};
> -
>  #define  NONE0
>  #define  TRAP1
>  #define  SYSCALL 2
> @@ -118,8 +112,8 @@ db_addr_t db_kdintr_symbol_value = 0;
>  boolean_tdb_trace_symbols_found = FALSE;
>  
>  void db_find_trace_symbols(void);
> -int db_numargs(struct x86_64_frame *);
> -void db_nextframe(struct x86_64_frame **, db_addr_t *, long *, int,
> +int db_numargs(struct callframe *);
> +void db_nextframe(struct callframe **, db_addr_t *, long *, int,
>  int (*) (const char *, ...));
>  
>  void
> @@ -143,7 +137,7 @@ db_find_trace_symbols(void)
>   * reliably determine the values currently, just return 0.
>   */
>  int
> -db_numargs(struct x86_64_frame *fp)
> +db_numargs(struct callframe *fp)
>  {
>   return 0;
>  }
> @@ -159,7 +153,7 @@ db_numargs(struct x86_64_frame *fp)
>   *   of the function that faulted, but that could get hairy.
>   */
>  void
> -db_nextframe(struct x86_64_frame **fp, db_addr_t *ip, long *argp, int 
> is_trap,
> +db_nextframe(struct callframe **fp, db_addr_t *ip, long *argp, int is_trap,
>  int (*pr)(const char *, ...))
>  {
>  
> @@ -167,7 +161,7 @@ db_nextframe(struct x86_64_frame **fp, d
>   case NONE:
>   *ip = (db_addr_t)
>   db_get_value((db_addr_t)&(*fp)->f_retaddr, 8, FALSE);
> - *fp = (struct x86_64_frame *)
> + *fp = (struct callframe *)
>   db_get_value((db_addr_t)&(*fp)->f_frame, 8, FALSE);
>   break;
>  
> @@ -190,7 +184,7 @@ db_nextframe(struct x86_64_frame **fp, d
>   (*pr)("--- interrupt ---\n");
>   break;
>   }
> - *fp = (struct x86_64_frame *)tf->tf_rbp;
> + *fp = (struct callframe *)tf->tf_rbp;
>   *ip = (db_addr_t)tf->tf_rip;
>   break;
>   }
> @@ -201,7 +195,7 @@ void
>  db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
>  char *modif, int (*pr)(const char *, ...))
>  {
> - struct x86_64_frame *frame, *lastframe;
> + struct callframe *frame, *lastframe;
>   long*argp;
>   db_addr_t   callpc;
>   int is_trap = 0;
> @@ -226,7 +220,7 @@ db_stack_trace_print(db_expr_t addr, boo
>   }
>  
>   if (!have_addr) {
> - frame = (struct x86_64_frame *)ddb_regs.tf_rbp;
> + frame = (struct callframe *)ddb_regs.tf_rbp;
>   callpc = (db_addr_t)ddb_regs.tf_rip;
>   } else {
>   if (trace_proc) {
> @@ -235,13 +229,13 @@ db_stack_trace_print(db_expr_t addr, boo
>   (*pr) ("db_trace.c: process not found\n");
>   return;
>   }
> - frame = (struct x86_64_frame *)p->p_addr->u_pcb.pcb_rbp;
> + frame = (struct callframe *)p->p_addr->u_pcb.pcb_rbp;
>   } else {
> - frame = (struct x86_64_frame *)addr;
> + frame = (struct callframe *)addr;
>   }
>   callpc = (db_addr_t)
>db_get_value((db_addr_t)&frame->f_retaddr, 8, FALSE);
> - frame = (struct x86_64_frame *)frame->f_frame;
> + frame = (struct callframe *)frame->f_frame;
>   }
>  
>   lastframe = 0;
> @@ -304,7 +298,7 @@ db_stack_trace_print(db_expr_t addr, boo
>* We have a breakpoint before the frame is set up
>* Use %esp instead
>*/
> - argp = &((struct x86_64_frame 
> *)(ddb_regs.tf_rsp-8))->f_arg0;
> + argp = &((struct callframe 
> *)(ddb_regs.tf_rsp-8))->f_arg0;
>   } else {
>   argp = &frame->f_arg0;
>   }
> @@ -323,7 +317,7 @@ db_stack_trace_print(db_expr_t addr, boo
>  
>   if (lastframe == 0 && offset == 0 && !have_addr) {
>  

Re: ddb: remove support for multiple symbol tables

2016-02-25 Thread Mike Larkin
On Thu, Feb 25, 2016 at 03:05:21PM +0100, Martin Pieuchot wrote:
> I'd like to be able to iterate over all the kernel symbols.  I could
> do like some of the functions below and abuse ``db_last_symtab'' but
> we since only have a single symbol table there's no point in keeping
> a complex interface. 
> 
> Ok?

comment inline.

-ml

> 
> Index: ddb/db_hangman.c
> ===
> RCS file: /cvs/src/sys/ddb/db_hangman.c,v
> retrieving revision 1.33
> diff -u -p -r1.33 db_hangman.c
> --- ddb/db_hangman.c  27 Jan 2016 10:37:12 -  1.33
> +++ ddb/db_hangman.c  25 Feb 2016 14:01:39 -
> @@ -88,20 +88,15 @@ db_hang_forall(db_symtab_t *stab, db_sym
>  static __inline char *
>  db_randomsym(size_t *lenp)
>  {
> - extern db_symtab_t db_symtabs[];
> - db_symtab_t *stab;
> - int nsymtabs, nsyms;
> + extern db_symtab_t db_symtab;
> + db_symtab_t *stab = &db_symtab;
> + int nsyms;
>   char*p, *q;
>   struct db_hang_forall_arg dfa;
>  
> - for (nsymtabs = 0; db_symtabs[nsymtabs].name != NULL; nsymtabs++)
> - ;
> -
> - if (nsymtabs == 0)
> + if (stab->start == 0)
>   return (NULL);
>  
> - stab = &db_symtabs[arc4random_uniform(nsymtabs)];
> -
>   dfa.cnt = 0;
>   db_elf_sym_forall(stab, db_hang_forall, &dfa);
>   nsyms = -dfa.cnt;
> @@ -114,9 +109,9 @@ db_randomsym(size_t *lenp)
>  
>   q = db_qualify(dfa.sym, stab->name);
>  
> - /* don't show symtab name if there are less than 3 of 'em */
> - if (nsymtabs < 3)
> - while (*q++ != ':');
> + /* don't show symtab name */
> + while (*q++ != ':')
> + ;
>  
>   /* strlen(q) && ignoring underscores and colons */
>   for ((*lenp) = 0, p = q; *p; p++)
> Index: ddb/db_sym.c
> ===
> RCS file: /cvs/src/sys/ddb/db_sym.c,v
> retrieving revision 1.44
> diff -u -p -r1.44 db_sym.c
> --- ddb/db_sym.c  12 Feb 2016 10:58:41 -  1.44
> +++ ddb/db_sym.c  25 Feb 2016 14:01:39 -
> @@ -48,9 +48,7 @@
>  #define  MAXNOSYMTABSMAXLKMS+1   /* Room for kernel + LKM's */
>  #endif
>  
> -db_symtab_t  db_symtabs[MAXNOSYMTABS] = {{0,},};
> -
> -db_symtab_t  *db_last_symtab;
> +db_symtab_t  db_symtab;
>  
>  extern char end[];
>  
> @@ -102,23 +100,12 @@ ddb_init(void)
>  int
>  db_add_symbol_table(char *start, char *end, const char *name, char *ref)
>  {
> - int slot;
> -
> - for (slot = 0; slot < MAXNOSYMTABS; slot++) {
> - if (db_symtabs[slot].name == NULL)
> - break;
> - }
> - if (slot >= MAXNOSYMTABS) {
> - db_printf("No slots left for %s symbol table", name);
> - return(-1);
> - }
> -
> - db_symtabs[slot].start = start;
> - db_symtabs[slot].end = end;
> - db_symtabs[slot].name = name;
> - db_symtabs[slot].private = ref;
> + db_symtab.start = start;
> + db_symtab.end = end;
> + db_symtab.name = name;
> + db_symtab.private = ref;
>  
> - return(slot);
> + return 0;
>  }
>  
>  /*
> @@ -127,22 +114,10 @@ db_add_symbol_table(char *start, char *e
>  void
>  db_del_symbol_table(char *name)
>  {
> - int slot;
> -
> - for (slot = 0; slot < MAXNOSYMTABS; slot++) {
> - if (db_symtabs[slot].name &&
> - ! strcmp(db_symtabs[slot].name, name))
> - break;
> - }
> - if (slot >= MAXNOSYMTABS) {
> - db_printf("Unable to find symbol table slot for %s.", name);
> - return;
> - }
> -
> - db_symtabs[slot].start = 0;
> - db_symtabs[slot].end = 0;
> - db_symtabs[slot].name = 0;
> - db_symtabs[slot].private = 0;
> + db_symtab.start = 0;
> + db_symtab.end = 0;
> + db_symtab.name = 0;
> + db_symtab.private = 0;
>  }
>  
>  /*
> @@ -194,54 +169,11 @@ db_value_of_name(char *name, db_expr_t *
>  
>  /*
>   * Lookup a symbol.
> - * If the symbol has a qualifier (e.g., ux:vm_map),
> - * then only the specified symbol table will be searched;
> - * otherwise, all symbol tables will be searched.
>   */
>  db_sym_t
>  db_lookup(char *symstr)
>  {
> - db_sym_t sp;
> - int i;
> - int symtab_start = 0;
> - int symtab_end = MAXNOSYMTABS;
> - char *cp;
> -
> - /*
> -  * Look for, remove, and remember any symbol table specifier.
> -  */
> - for (cp = symstr; *cp; cp++) {
> - if (*cp == ':') {
> - *cp = '\0';
> - for (i = 0; i < MAXNOSYMTABS; i++) {
> - if (db_symtabs[i].name &&
> - ! strcmp(symstr, db_symtabs[i].name)) {
> - symtab_start = i;
> - symtab_end = i + 1;
> - break;
> - }
> - }
> - *c

x86 callframe definitions

2016-02-25 Thread Martin Pieuchot
This rename and move the i386 and amd64 ``callframe'' structures in order
to use it in MI code.  My goal is to unify our architectures to be able
to retrieve the PC of the calling function with as little MD code as
possible.

There's no functional change in this diff.  ok?

Index: amd64/amd64/db_trace.c
===
RCS file: /cvs/src/sys/arch/amd64/amd64/db_trace.c,v
retrieving revision 1.13
diff -u -p -r1.13 db_trace.c
--- amd64/amd64/db_trace.c  28 Jun 2015 01:16:28 -  1.13
+++ amd64/amd64/db_trace.c  25 Feb 2016 14:06:10 -
@@ -100,12 +100,6 @@ db_x86_64_regop(struct db_variable *vp, 
  */
 #defineINKERNEL(va)(((vaddr_t)(va)) >= VM_MIN_KERNEL_ADDRESS)
 
-struct x86_64_frame {
-   struct x86_64_frame *f_frame;
-   longf_retaddr;
-   longf_arg0;
-};
-
 #defineNONE0
 #defineTRAP1
 #defineSYSCALL 2
@@ -118,8 +112,8 @@ db_addr_t   db_kdintr_symbol_value = 0;
 boolean_t  db_trace_symbols_found = FALSE;
 
 void db_find_trace_symbols(void);
-int db_numargs(struct x86_64_frame *);
-void db_nextframe(struct x86_64_frame **, db_addr_t *, long *, int,
+int db_numargs(struct callframe *);
+void db_nextframe(struct callframe **, db_addr_t *, long *, int,
 int (*) (const char *, ...));
 
 void
@@ -143,7 +137,7 @@ db_find_trace_symbols(void)
  * reliably determine the values currently, just return 0.
  */
 int
-db_numargs(struct x86_64_frame *fp)
+db_numargs(struct callframe *fp)
 {
return 0;
 }
@@ -159,7 +153,7 @@ db_numargs(struct x86_64_frame *fp)
  *   of the function that faulted, but that could get hairy.
  */
 void
-db_nextframe(struct x86_64_frame **fp, db_addr_t *ip, long *argp, int is_trap,
+db_nextframe(struct callframe **fp, db_addr_t *ip, long *argp, int is_trap,
 int (*pr)(const char *, ...))
 {
 
@@ -167,7 +161,7 @@ db_nextframe(struct x86_64_frame **fp, d
case NONE:
*ip = (db_addr_t)
db_get_value((db_addr_t)&(*fp)->f_retaddr, 8, FALSE);
-   *fp = (struct x86_64_frame *)
+   *fp = (struct callframe *)
db_get_value((db_addr_t)&(*fp)->f_frame, 8, FALSE);
break;
 
@@ -190,7 +184,7 @@ db_nextframe(struct x86_64_frame **fp, d
(*pr)("--- interrupt ---\n");
break;
}
-   *fp = (struct x86_64_frame *)tf->tf_rbp;
+   *fp = (struct callframe *)tf->tf_rbp;
*ip = (db_addr_t)tf->tf_rip;
break;
}
@@ -201,7 +195,7 @@ void
 db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
 char *modif, int (*pr)(const char *, ...))
 {
-   struct x86_64_frame *frame, *lastframe;
+   struct callframe *frame, *lastframe;
long*argp;
db_addr_t   callpc;
int is_trap = 0;
@@ -226,7 +220,7 @@ db_stack_trace_print(db_expr_t addr, boo
}
 
if (!have_addr) {
-   frame = (struct x86_64_frame *)ddb_regs.tf_rbp;
+   frame = (struct callframe *)ddb_regs.tf_rbp;
callpc = (db_addr_t)ddb_regs.tf_rip;
} else {
if (trace_proc) {
@@ -235,13 +229,13 @@ db_stack_trace_print(db_expr_t addr, boo
(*pr) ("db_trace.c: process not found\n");
return;
}
-   frame = (struct x86_64_frame *)p->p_addr->u_pcb.pcb_rbp;
+   frame = (struct callframe *)p->p_addr->u_pcb.pcb_rbp;
} else {
-   frame = (struct x86_64_frame *)addr;
+   frame = (struct callframe *)addr;
}
callpc = (db_addr_t)
 db_get_value((db_addr_t)&frame->f_retaddr, 8, FALSE);
-   frame = (struct x86_64_frame *)frame->f_frame;
+   frame = (struct callframe *)frame->f_frame;
}
 
lastframe = 0;
@@ -304,7 +298,7 @@ db_stack_trace_print(db_expr_t addr, boo
 * We have a breakpoint before the frame is set up
 * Use %esp instead
 */
-   argp = &((struct x86_64_frame 
*)(ddb_regs.tf_rsp-8))->f_arg0;
+   argp = &((struct callframe 
*)(ddb_regs.tf_rsp-8))->f_arg0;
} else {
argp = &frame->f_arg0;
}
@@ -323,7 +317,7 @@ db_stack_trace_print(db_expr_t addr, boo
 
if (lastframe == 0 && offset == 0 && !have_addr) {
/* Frame really belongs to next callpc */
-   lastframe = (struct x86_64_frame *)(ddb_regs.tf_rsp-8);
+   lastframe = (struct callframe *)(ddb_regs.tf_rsp-8);
   

ddb: remove support for multiple symbol tables

2016-02-25 Thread Martin Pieuchot
I'd like to be able to iterate over all the kernel symbols.  I could
do like some of the functions below and abuse ``db_last_symtab'' but
we since only have a single symbol table there's no point in keeping
a complex interface. 

Ok?

Index: ddb/db_hangman.c
===
RCS file: /cvs/src/sys/ddb/db_hangman.c,v
retrieving revision 1.33
diff -u -p -r1.33 db_hangman.c
--- ddb/db_hangman.c27 Jan 2016 10:37:12 -  1.33
+++ ddb/db_hangman.c25 Feb 2016 14:01:39 -
@@ -88,20 +88,15 @@ db_hang_forall(db_symtab_t *stab, db_sym
 static __inline char *
 db_randomsym(size_t *lenp)
 {
-   extern db_symtab_t db_symtabs[];
-   db_symtab_t *stab;
-   int nsymtabs, nsyms;
+   extern db_symtab_t db_symtab;
+   db_symtab_t *stab = &db_symtab;
+   int nsyms;
char*p, *q;
struct db_hang_forall_arg dfa;
 
-   for (nsymtabs = 0; db_symtabs[nsymtabs].name != NULL; nsymtabs++)
-   ;
-
-   if (nsymtabs == 0)
+   if (stab->start == 0)
return (NULL);
 
-   stab = &db_symtabs[arc4random_uniform(nsymtabs)];
-
dfa.cnt = 0;
db_elf_sym_forall(stab, db_hang_forall, &dfa);
nsyms = -dfa.cnt;
@@ -114,9 +109,9 @@ db_randomsym(size_t *lenp)
 
q = db_qualify(dfa.sym, stab->name);
 
-   /* don't show symtab name if there are less than 3 of 'em */
-   if (nsymtabs < 3)
-   while (*q++ != ':');
+   /* don't show symtab name */
+   while (*q++ != ':')
+   ;
 
/* strlen(q) && ignoring underscores and colons */
for ((*lenp) = 0, p = q; *p; p++)
Index: ddb/db_sym.c
===
RCS file: /cvs/src/sys/ddb/db_sym.c,v
retrieving revision 1.44
diff -u -p -r1.44 db_sym.c
--- ddb/db_sym.c12 Feb 2016 10:58:41 -  1.44
+++ ddb/db_sym.c25 Feb 2016 14:01:39 -
@@ -48,9 +48,7 @@
 #defineMAXNOSYMTABSMAXLKMS+1   /* Room for kernel + LKM's */
 #endif
 
-db_symtab_tdb_symtabs[MAXNOSYMTABS] = {{0,},};
-
-db_symtab_t*db_last_symtab;
+db_symtab_tdb_symtab;
 
 extern char end[];
 
@@ -102,23 +100,12 @@ ddb_init(void)
 int
 db_add_symbol_table(char *start, char *end, const char *name, char *ref)
 {
-   int slot;
-
-   for (slot = 0; slot < MAXNOSYMTABS; slot++) {
-   if (db_symtabs[slot].name == NULL)
-   break;
-   }
-   if (slot >= MAXNOSYMTABS) {
-   db_printf("No slots left for %s symbol table", name);
-   return(-1);
-   }
-
-   db_symtabs[slot].start = start;
-   db_symtabs[slot].end = end;
-   db_symtabs[slot].name = name;
-   db_symtabs[slot].private = ref;
+   db_symtab.start = start;
+   db_symtab.end = end;
+   db_symtab.name = name;
+   db_symtab.private = ref;
 
-   return(slot);
+   return 0;
 }
 
 /*
@@ -127,22 +114,10 @@ db_add_symbol_table(char *start, char *e
 void
 db_del_symbol_table(char *name)
 {
-   int slot;
-
-   for (slot = 0; slot < MAXNOSYMTABS; slot++) {
-   if (db_symtabs[slot].name &&
-   ! strcmp(db_symtabs[slot].name, name))
-   break;
-   }
-   if (slot >= MAXNOSYMTABS) {
-   db_printf("Unable to find symbol table slot for %s.", name);
-   return;
-   }
-
-   db_symtabs[slot].start = 0;
-   db_symtabs[slot].end = 0;
-   db_symtabs[slot].name = 0;
-   db_symtabs[slot].private = 0;
+   db_symtab.start = 0;
+   db_symtab.end = 0;
+   db_symtab.name = 0;
+   db_symtab.private = 0;
 }
 
 /*
@@ -194,54 +169,11 @@ db_value_of_name(char *name, db_expr_t *
 
 /*
  * Lookup a symbol.
- * If the symbol has a qualifier (e.g., ux:vm_map),
- * then only the specified symbol table will be searched;
- * otherwise, all symbol tables will be searched.
  */
 db_sym_t
 db_lookup(char *symstr)
 {
-   db_sym_t sp;
-   int i;
-   int symtab_start = 0;
-   int symtab_end = MAXNOSYMTABS;
-   char *cp;
-
-   /*
-* Look for, remove, and remember any symbol table specifier.
-*/
-   for (cp = symstr; *cp; cp++) {
-   if (*cp == ':') {
-   *cp = '\0';
-   for (i = 0; i < MAXNOSYMTABS; i++) {
-   if (db_symtabs[i].name &&
-   ! strcmp(symstr, db_symtabs[i].name)) {
-   symtab_start = i;
-   symtab_end = i + 1;
-   break;
-   }
-   }
-   *cp = ':';
-   if (i == MAXNOSYMTABS) {
-   db_error("invalid symbol table name");
-   /*NOTREACHED*/
-   }
-   

gc the unp_gcing flag

2016-02-25 Thread David Gwynne
the gc is run from a task in the systq, so we dont need a flag to
serialise it. it is already serialised.

ok?

Index: uipc_usrreq.c
===
RCS file: /cvs/src/sys/kern/uipc_usrreq.c,v
retrieving revision 1.95
diff -u -p -r1.95 uipc_usrreq.c
--- uipc_usrreq.c   5 Dec 2015 10:11:53 -   1.95
+++ uipc_usrreq.c   25 Feb 2016 11:38:16 -
@@ -882,7 +882,7 @@ fail:
return (error);
 }
 
-intunp_defer, unp_gcing;
+intunp_defer;
 
 void
 unp_gc(void *arg __unused)
@@ -893,10 +893,6 @@ unp_gc(void *arg __unused)
struct unpcb *unp;
int nunref, i;
 
-   if (unp_gcing)
-   return;
-   unp_gcing = 1;
-
/* close any fds on the deferred list */
while ((defer = SLIST_FIRST(&unp_deferred)) != NULL) {
SLIST_REMOVE_HEAD(&unp_deferred, ud_link);
@@ -991,7 +987,6 @@ unp_gc(void *arg __unused)
unp_discard);
}
}
-   unp_gcing = 0;
 }
 
 void



what's in i386 /boot program headers after 256 byte space ?

2016-02-25 Thread logicbaby
I'am reading i386 boot code, find

 

LINKADDR=0x40120

LOADADDR=0x4

 

What is in between LOADADDR and LOADADDR has 288 byte ?

and in boot file ELF file header 52 byte add program header 32 byte to .txt
at 120h has 256 byte space, use hex tool view this 256 space fill 0; 

how generate this 256 space at link stage? And This is used for what?

 

thanks



Re: boot_amd64(8) - mention biosboot(8)

2016-02-25 Thread Jason McIntyre
On Thu, Feb 25, 2016 at 10:18:17AM +0100, Theo Buehler wrote:
> On Thu, Feb 25, 2016 at 08:53:34AM +, Jason McIntyre wrote:
> > On Thu, Feb 25, 2016 at 08:15:54AM +0100, Michal Mazurek wrote:
> > > boot(8) says: "As described in boot_amd64(8), this program is loaded by
> > > the biosboot(8)", but other than mentioning "/usr/mdec/biosboot"
> > > boot_amd64(8) does not describe biosboot(8). My attempt at a fix:
> > > 
> 
> Definitely a good idea.
> 
> > still the boot docs are too hairy for me. some oks for this,
> > please.
> 
> Here's a patch that can be applied directly from /usr/src implementing
> jmc@'s tweaks. I'd be strongly in favor of putting this in.
> 

ok, but one more pesky comma needed (well, in two places):

> Index: share/man/man8/man8.amd64/boot_amd64.8
> ===
> RCS file: /var/cvs/src/share/man/man8/man8.amd64/boot_amd64.8,v
> retrieving revision 1.8
> diff -u -p -r1.8 boot_amd64.8
> --- share/man/man8/man8.amd64/boot_amd64.820 Apr 2011 00:41:19 -  
> 1.8
> +++ share/man/man8/man8.amd64/boot_amd64.825 Feb 2016 09:08:31 -
> @@ -125,10 +125,11 @@ On most
>  .Ox
>  systems, booting
>  .Ox
> -from the BIOS will eventually load the
> +from the BIOS will load the
>  .Ox Ns -specific
> -amd64 bootstrapping code.
> -This versatile program is described in a separate document,
> +first-stage bootstrap,
> +.Xr biosboot 8 ,
> +which in turn will locate and load the second-stage bootstrap

again after "bootstrap" (here and below).
jmc

>  .Xr boot 8 .
>  Other bootstrapping software may be used, and can chain-load the
>  .Ox
> @@ -171,6 +172,7 @@ PXE bootstrap
>  .El
>  .Sh SEE ALSO
>  .Xr ddb 4 ,
> +.Xr biosboot 8 ,
>  .Xr boot 8 ,
>  .Xr halt 8 ,
>  .Xr init 8 ,
> Index: share/man/man8/man8.i386/boot_i386.8
> ===
> RCS file: /var/cvs/src/share/man/man8/man8.i386/boot_i386.8,v
> retrieving revision 1.16
> diff -u -p -r1.16 boot_i386.8
> --- share/man/man8/man8.i386/boot_i386.8  23 Jan 2014 12:49:12 -  
> 1.16
> +++ share/man/man8/man8.i386/boot_i386.8  25 Feb 2016 09:08:11 -
> @@ -125,10 +125,11 @@ On most
>  .Ox
>  systems, booting
>  .Ox
> -from the BIOS will eventually load the
> +from the BIOS will load the
>  .Ox Ns -specific
> -i386 bootstrapping code.
> -This versatile program is described in a separate document,
> +first-stage bootstrap,
> +.Xr biosboot 8 ,
> +which in turn will locate and load the second-stage bootstrap
>  .Xr boot 8 .
>  Other bootstrapping software may be used, and can chain-load the
>  .Ox
> @@ -171,6 +172,7 @@ PXE bootstrap
>  .El
>  .Sh SEE ALSO
>  .Xr ddb 4 ,
> +.Xr biosboot 8 ,
>  .Xr boot 8 ,
>  .Xr halt 8 ,
>  .Xr init 8 ,
> 



Re: boot_amd64(8) - mention biosboot(8)

2016-02-25 Thread Michal Mazurek
On 08:53:34, 25.02.16, Jason McIntyre wrote:
> there should be a comma after "bootstrap"

> and the biosboot Xr should go before the boot Xr

> ditto for the parts below.

Thanks, corrected:

Index: man8.amd64/boot_amd64.8
===
RCS file: /cvs/src/share/man/man8/man8.amd64/boot_amd64.8,v
retrieving revision 1.8
diff -u -p -r1.8 boot_amd64.8
--- man8.amd64/boot_amd64.8 20 Apr 2011 00:41:19 -  1.8
+++ man8.amd64/boot_amd64.8 25 Feb 2016 09:23:05 -
@@ -125,10 +125,11 @@ On most
 .Ox
 systems, booting
 .Ox
-from the BIOS will eventually load the
+from the BIOS will load the
 .Ox Ns -specific
-amd64 bootstrapping code.
-This versatile program is described in a separate document,
+first-stage bootstrap,
+.Xr biosboot 8 ,
+which in turn will locate and load the second-stage bootstrap
 .Xr boot 8 .
 Other bootstrapping software may be used, and can chain-load the
 .Ox
@@ -171,6 +172,7 @@ PXE bootstrap
 .El
 .Sh SEE ALSO
 .Xr ddb 4 ,
+.Xr biosboot 8 ,
 .Xr boot 8 ,
 .Xr halt 8 ,
 .Xr init 8 ,
Index: man8.i386/boot_i386.8
===
RCS file: /cvs/src/share/man/man8/man8.i386/boot_i386.8,v
retrieving revision 1.16
diff -u -p -r1.16 boot_i386.8
--- man8.i386/boot_i386.8   23 Jan 2014 12:49:12 -  1.16
+++ man8.i386/boot_i386.8   25 Feb 2016 09:23:05 -
@@ -125,10 +125,11 @@ On most
 .Ox
 systems, booting
 .Ox
-from the BIOS will eventually load the
+from the BIOS will load the
 .Ox Ns -specific
-i386 bootstrapping code.
-This versatile program is described in a separate document,
+first-stage bootstrap,
+.Xr biosboot 8 ,
+which in turn will locate and load the second-stage bootstrap
 .Xr boot 8 .
 Other bootstrapping software may be used, and can chain-load the
 .Ox
@@ -171,6 +172,7 @@ PXE bootstrap
 .El
 .Sh SEE ALSO
 .Xr ddb 4 ,
+.Xr biosboot 8 ,
 .Xr boot 8 ,
 .Xr halt 8 ,
 .Xr init 8 ,

-- 
Michal Mazurek



Re: boot_amd64(8) - mention biosboot(8)

2016-02-25 Thread Theo Buehler
On Thu, Feb 25, 2016 at 08:53:34AM +, Jason McIntyre wrote:
> On Thu, Feb 25, 2016 at 08:15:54AM +0100, Michal Mazurek wrote:
> > boot(8) says: "As described in boot_amd64(8), this program is loaded by
> > the biosboot(8)", but other than mentioning "/usr/mdec/biosboot"
> > boot_amd64(8) does not describe biosboot(8). My attempt at a fix:
> > 

Definitely a good idea.

> still the boot docs are too hairy for me. some oks for this,
> please.

Here's a patch that can be applied directly from /usr/src implementing
jmc@'s tweaks. I'd be strongly in favor of putting this in.

Index: share/man/man8/man8.amd64/boot_amd64.8
===
RCS file: /var/cvs/src/share/man/man8/man8.amd64/boot_amd64.8,v
retrieving revision 1.8
diff -u -p -r1.8 boot_amd64.8
--- share/man/man8/man8.amd64/boot_amd64.8  20 Apr 2011 00:41:19 -  
1.8
+++ share/man/man8/man8.amd64/boot_amd64.8  25 Feb 2016 09:08:31 -
@@ -125,10 +125,11 @@ On most
 .Ox
 systems, booting
 .Ox
-from the BIOS will eventually load the
+from the BIOS will load the
 .Ox Ns -specific
-amd64 bootstrapping code.
-This versatile program is described in a separate document,
+first-stage bootstrap,
+.Xr biosboot 8 ,
+which in turn will locate and load the second-stage bootstrap
 .Xr boot 8 .
 Other bootstrapping software may be used, and can chain-load the
 .Ox
@@ -171,6 +172,7 @@ PXE bootstrap
 .El
 .Sh SEE ALSO
 .Xr ddb 4 ,
+.Xr biosboot 8 ,
 .Xr boot 8 ,
 .Xr halt 8 ,
 .Xr init 8 ,
Index: share/man/man8/man8.i386/boot_i386.8
===
RCS file: /var/cvs/src/share/man/man8/man8.i386/boot_i386.8,v
retrieving revision 1.16
diff -u -p -r1.16 boot_i386.8
--- share/man/man8/man8.i386/boot_i386.823 Jan 2014 12:49:12 -  
1.16
+++ share/man/man8/man8.i386/boot_i386.825 Feb 2016 09:08:11 -
@@ -125,10 +125,11 @@ On most
 .Ox
 systems, booting
 .Ox
-from the BIOS will eventually load the
+from the BIOS will load the
 .Ox Ns -specific
-i386 bootstrapping code.
-This versatile program is described in a separate document,
+first-stage bootstrap,
+.Xr biosboot 8 ,
+which in turn will locate and load the second-stage bootstrap
 .Xr boot 8 .
 Other bootstrapping software may be used, and can chain-load the
 .Ox
@@ -171,6 +172,7 @@ PXE bootstrap
 .El
 .Sh SEE ALSO
 .Xr ddb 4 ,
+.Xr biosboot 8 ,
 .Xr boot 8 ,
 .Xr halt 8 ,
 .Xr init 8 ,



Re: boot_amd64(8) - mention biosboot(8)

2016-02-25 Thread Jason McIntyre
On Thu, Feb 25, 2016 at 08:15:54AM +0100, Michal Mazurek wrote:
> boot(8) says: "As described in boot_amd64(8), this program is loaded by
> the biosboot(8)", but other than mentioning "/usr/mdec/biosboot"
> boot_amd64(8) does not describe biosboot(8). My attempt at a fix:
> 

morning.

> 
> Index: boot_amd64.8
> ===
> RCS file: /cvs/src/share/man/man8/man8.amd64/boot_amd64.8,v
> retrieving revision 1.8
> diff -u -p -r1.8 boot_amd64.8
> --- boot_amd64.8  20 Apr 2011 00:41:19 -  1.8
> +++ boot_amd64.8  25 Feb 2016 07:12:59 -
> @@ -125,10 +125,11 @@ On most
>  .Ox
>  systems, booting
>  .Ox
> -from the BIOS will eventually load the
> +from the BIOS will load the
>  .Ox Ns -specific
> -amd64 bootstrapping code.
> -This versatile program is described in a separate document,
> +first-stage bootstrap

there should be a comma after "bootstrap"

> +.Xr biosboot 8 ,
> +which in turn will locate and load the second-stage bootstrap
>  .Xr boot 8 .
>  Other bootstrapping software may be used, and can chain-load the
>  .Ox
> @@ -172,6 +173,7 @@ PXE bootstrap
>  .Sh SEE ALSO
>  .Xr ddb 4 ,
>  .Xr boot 8 ,
> +.Xr biosboot 8 ,

and the biosboot Xr should go before the boot Xr

ditto for the parts below.

still the boot docs are too hairy for me. some oks for this,
please.

jmc

>  .Xr halt 8 ,
>  .Xr init 8 ,
>  .Xr installboot 8 ,
> 
> Index: boot_i386.8
> ===
> RCS file: /cvs/src/share/man/man8/man8.i386/boot_i386.8,v
> retrieving revision 1.16
> diff -u -p -r1.16 boot_i386.8
> --- boot_i386.8   23 Jan 2014 12:49:12 -  1.16
> +++ boot_i386.8   25 Feb 2016 07:14:11 -
> @@ -125,10 +125,11 @@ On most
>  .Ox
>  systems, booting
>  .Ox
> -from the BIOS will eventually load the
> +from the BIOS will load the
>  .Ox Ns -specific
> -i386 bootstrapping code.
> -This versatile program is described in a separate document,
> +first-stage bootstrap
> +.Xr biosboot 8 ,
> +which in turn will locate and load the second-stage bootstrap
>  .Xr boot 8 .
>  Other bootstrapping software may be used, and can chain-load the
>  .Ox
> @@ -172,6 +173,7 @@ PXE bootstrap
>  .Sh SEE ALSO
>  .Xr ddb 4 ,
>  .Xr boot 8 ,
> +.Xr biosboot 8 ,
>  .Xr halt 8 ,
>  .Xr init 8 ,
>  .Xr installboot 8 ,
> 
> -- 
> Michal Mazurek
>