]> Zhao Yanbai Git Server - minix.git/log
minix.git
10 years agotests: remove select subdirectory 56/956/2
David van Moolenbroek [Fri, 30 Aug 2013 16:48:56 +0000 (18:48 +0200)]
tests: remove select subdirectory

This test set has been obsoleted by test40.

Change-Id: I55439152824906778ad07d409dfb327ac10bea70

10 years agotests: add test76 for interrupting VFS operations 55/955/2
David van Moolenbroek [Fri, 30 Aug 2013 16:43:23 +0000 (18:43 +0200)]
tests: add test76 for interrupting VFS operations

Change-Id: Ic436cac61de8c42e0c7ee2d442c647528654cde9

10 years agoVFS: fix interruption of blocking pipe operations 54/954/2
David van Moolenbroek [Wed, 28 Aug 2013 11:08:16 +0000 (13:08 +0200)]
VFS: fix interruption of blocking pipe operations

POSIX states that when interrupted, partially successful pipe
operations should return the partial result rather than EINTR. VFS
previously wouldn't look at the partial result, and not clear it
either, which would result in a panic upon the next pipe operation.

Change-Id: Ia1eb72b4b77394051444e63a1390d49bb315eb04

10 years agolibmthread: do not dump stack for free threads 53/953/2
David van Moolenbroek [Thu, 29 Aug 2013 22:57:16 +0000 (00:57 +0200)]
libmthread: do not dump stack for free threads

Change-Id: Ic438a252f5bddaf1513f554c71173e6fffb0c674

10 years agoVFS: worker thread model overhaul 52/952/2
David van Moolenbroek [Fri, 30 Aug 2013 12:00:50 +0000 (14:00 +0200)]
VFS: worker thread model overhaul

The main purpose of this patch is to fix handling of unpause calls
from PM while another call is ongoing. The solution to this problem
sparked a full revision of the threading model, consisting of a large
number of related changes:

- all active worker threads are now always associated with a process,
  and every process has at most one active thread working for it;
- the process lock is always held by a process's worker thread;
- a process can now have both normal work and postponed PM work
  associated to it;
- timer expiry and non-postponed PM work is done from the main thread;
- filp garbage collection is done from a thread associated with VFS;
- reboot calls from PM are now done from a thread associated with PM;
- the DS events handler is protected from starting multiple threads;
- support for a system worker thread has been removed;
- the deadlock recovery thread has been replaced by a parameter to the
  worker_start() function; the number of worker threads has
  consequently been increased by one;
- saving and restoring of global but per-thread variables is now
  centralized in worker_suspend() and worker_resume(); err_code is now
  saved and restored in all cases;
- the concept of jobs has been removed, and job_m_in now points to a
  message stored in the worker thread structure instead;
- the PM lock has been removed;
- the separate exec lock has been replaced by a lock on the VM
  process, which was already being locked for exec calls anyway;
- PM_UNPAUSE is now processed as a postponed PM request, from a thread
  associated with the target process;
- the FP_DROP_WORK flag has been removed, since it is no longer more
  than just an optimization and only applied to processes operating on
  a pipe when getting killed;
- assignment to "fp" now takes place only when obtaining new work in
  the main thread or a worker thread, when resuming execution of a
  thread, and in the special case of exiting processes during reboot;
- there are no longer special cases where the yield() call is used to
  force a thread to run.

Change-Id: I7a97b9b95c2450454a9b5318dfa0e6150d4e6858

10 years agoRetire ptrace(T_DUMPCORE), dumpcore(1), gcore(1) 51/951/2
David van Moolenbroek [Wed, 28 Aug 2013 13:58:30 +0000 (15:58 +0200)]
Retire ptrace(T_DUMPCORE), dumpcore(1), gcore(1)

The T_DUMPCORE implementation was not only broken - it would currently
produce a coredump of the tracer process rather than the traced
process - but also deeply flawed, and fixing it would require serious
alteration of PM's internal state machine. It should be possible to
implement the same functionality in userland, and that is now the
suggested way forward. For now, also remove the (identical) utilities
using T_DUMPCORE: dumpcore(1) and gcore(1).

Change-Id: I1d51be19c739362b8a5833de949b76382a1edbcc

10 years agoVFS: process char driver replies from main thread 50/950/2
David van Moolenbroek [Fri, 30 Aug 2013 11:42:51 +0000 (13:42 +0200)]
VFS: process char driver replies from main thread

Previously, processing of some replies coming from character drivers
could block on locks, and therefore, such processing was done from
threads that were associated to the character driver process. The
hidden consequence of this was that if all threads were in use, VFS
could drop replies coming from the driver. This patch returns VFS to
a situation where the replies from character drivers are processed
instantly from the main thread, by removing the situations that may
cause VFS to block while handling those replies.

- change the locking model for select, so that it will never block
  on any processing that happens after the select call has been set
  up, in particular processing of character driver select replies;
- clearly mark all select routines that may never block;
- protect against race conditions in do_select as result of the
  locking that still does happen there (as is required for pipes);
- also handle select timers from the main thread;
- move processing of character driver replies into device.c.

Change-Id: I4dc8e69f265cbd178de0fbf321d35f58f067cc57

10 years agoVFS: properly cancel select queries on unpause 49/949/2
David van Moolenbroek [Sat, 24 Aug 2013 22:26:38 +0000 (00:26 +0200)]
VFS: properly cancel select queries on unpause

Change-Id: I16e71db3f5c1bcc7ba6045bc9f02b13d71dc31eb

10 years agoVFS: remove support for sync char driver protocol 48/948/2
David van Moolenbroek [Fri, 30 Aug 2013 11:33:56 +0000 (13:33 +0200)]
VFS: remove support for sync char driver protocol

Change-Id: I57cc870a053b813b3a3fc45da46606ea84fe4cb1

10 years agoVFS: remove FP_BLOCKED_ON_DOPEN 47/947/2
David van Moolenbroek [Fri, 30 Aug 2013 11:00:44 +0000 (13:00 +0200)]
VFS: remove FP_BLOCKED_ON_DOPEN

These days, DEV_OPEN calls to character drivers block the calling
thread until completion or failure, and thus never return SUSPEND to
the caller. The same already applied to BDEV_OPEN calls to block
drivers. It has thus become impossible for a process to enter a state
of being blocked on a device open call.

There is currently no support for restarting device open calls to
restarted character drivers. This support was present in the _DOPEN
logic, but was already no longer triggering. In the future, this case
should be handled by the thread performing the open request.

Change-Id: I6cc1e7b4c9ed116c6ce160b315e6e060124dce00

10 years agoPFS: remember request information for IOCTLs 46/946/2
David van Moolenbroek [Fri, 30 Aug 2013 10:18:27 +0000 (12:18 +0200)]
PFS: remember request information for IOCTLs

Not doing so caused PFS to commit protocol violations by relying on
stale information when sending replies. This stale information always
happened to be correct, which is why the problem went unnoticed.
Change-Id: Ia42ca670718d6e731193cd2c34a3ff455f8a94d3

10 years agoRetire the synchronous character driver protocol 45/945/2
David van Moolenbroek [Fri, 30 Aug 2013 09:14:03 +0000 (11:14 +0200)]
Retire the synchronous character driver protocol

- change all sync char drivers into async drivers;
- retire support for the sync protocol in libchardev;
- remove async dev style, as this is now the default;
- remove dev_status from VFS;
- clean up now-unused protocol messages.

Change-Id: I6aacff712292f6b29f2ccd51bc1e7d7003723e87

10 years agoSync char protocol: add nonblocking transfer flag 44/944/2
David van Moolenbroek [Fri, 30 Aug 2013 08:48:34 +0000 (10:48 +0200)]
Sync char protocol: add nonblocking transfer flag

The async char protocol already has this, so this patch closes the
gap between the two protocols a bit. Support for this flag has been
added to all sync char drivers that support CANCEL at all.

The LOG driver was already using the asynchronous protocol, but it
did not support the nonblocking transfer flag. This has been fixed
as well.

Change-Id: Ia55432c9f102765b59ad3feb45a8bd47a782c93f

10 years agoVFS: set w_drv_sendrec only when needed 43/943/2
David van Moolenbroek [Sat, 24 Aug 2013 10:29:39 +0000 (12:29 +0200)]
VFS: set w_drv_sendrec only when needed

As with w_task, this ensures that the field remains cleared if it is
not used. Without this, worker_stop could mistakenly identify a thread
as talking to a device driver rather than a (crashed) file server.

Change-Id: I7d3ebed3efc3cd4f5c891f61c67a6463109b6376

10 years agoVFS: set w_task only when needed 42/942/2
Thomas Veerman [Sat, 24 Aug 2013 10:23:41 +0000 (12:23 +0200)]
VFS: set w_task only when needed

It was always set, but not always cleared, when talking to asynchronous
drivers. This could cause erratic behavior upon a driver crash.

Normally, a worker thread's w_task field is set when it's about to
communicate with a driver or FS. Then upon receiving a reply we can
do sanity checks (that the thread we want to wake up was actually
waiting for a reply). Also, when a driver/FS crashes, we can identify
which worker threads were talking to the crashed endpoint and handle
the error gracefully.

Asynchronous drivers are a bit special, though. In most cases, the
sender of the request is not interested in the reply (the sender was
suspended and only wants to know whether the request was successfully
caried out or not). However, the open request is special, as the reply
carries information needed by the sender. This is the only request
where a worker thread actually yields and waits for the result. This is
also the only case where we're interested in setting w_task for
asynchronous drivers.

Change-Id: Ia1ce2747937df376122b5e13b6a069de27fcc379

10 years agoRemoving CSU patches 41/941/2
Lionel Sambuc [Fri, 13 Sep 2013 18:12:22 +0000 (20:12 +0200)]
Removing CSU patches

 * Removed startup code patches in lib/csu regarding kernel to userland
   ABI.

 * Aligned stack layout on NetBSD stack layout.

 * Generate valid stack pointers instead of offsets by taking into account
   _minix_kerninfo->kinfo->user_sp.

 * Refactored stack generation, by moving part of execve in two
   functions {minix_stack_params(), minix_stack_fill()} and using them
   in execve(), rs and vm.

 * Changed load offset of rtld (ld.so) to:
      execi.args.stack_high - execi.args.stack_size - 0xa00000
   which is 10MB below the main executable stack.

Change-Id: I839daf3de43321cded44105634102d419cb36cec

10 years agoSet M3_STRING to M3_LONG_STRING (ABI break) 40/940/2
David van Moolenbroek [Sun, 1 Sep 2013 08:29:57 +0000 (10:29 +0200)]
Set M3_STRING to M3_LONG_STRING (ABI break)

Change-Id: Id48bbd4ba3000acf8a891445b4c890b1b42bd72f

10 years agoRemove support for obsolete 3.2.1 ABI 39/939/2
David van Moolenbroek [Sat, 31 Aug 2013 21:11:34 +0000 (23:11 +0200)]
Remove support for obsolete 3.2.1 ABI

Change-Id: I76b4960bda41f55d9c42f8c99c5beae3424ca851

10 years agoFix various file system warnings 38/938/2
David van Moolenbroek [Sat, 31 Aug 2013 20:59:44 +0000 (22:59 +0200)]
Fix various file system warnings

Change-Id: Ied10498c3ae14f9f2fd06914f23239df330fa296

10 years agoVFS/FS: replace protocol version with flag field 37/937/2
David van Moolenbroek [Sat, 31 Aug 2013 19:48:15 +0000 (21:48 +0200)]
VFS/FS: replace protocol version with flag field

The main motivation for this change is that only Loris supports
multithreading, and Loris supports dynamic thread allocation, so the
number of supported threads can be implemented as a bit flag (i.e.,
either 1 or "at least as many as VFS has"). The ABI break obviates the
need to support file system versioning at this time, and several
other aspects are better implemented as flags as well. Other changes:

- replace peek/bpeek test upon mount with FS flag as well;
- mark libsffs as 64-bit file size capable;
- remove old (3.2.1) getdents support.

Change-Id: I313eace9c50ed816656c31cd47d969033d952a03

10 years agoImport NetBSD df(1) 36/936/2
David van Moolenbroek [Mon, 19 Aug 2013 18:34:15 +0000 (20:34 +0200)]
Import NetBSD df(1)

Change-Id: I7a99e335da666a15b43b9daeb59dbfee516f0118

10 years agoEnable getmntinfo(3) 35/935/2
David van Moolenbroek [Mon, 19 Aug 2013 23:33:43 +0000 (01:33 +0200)]
Enable getmntinfo(3)

Change-Id: Ida9b0660471bb9fde3cdca6c9b9fd9e94341e02f

10 years agotest55: add tests for getvfsstat(2) 34/934/2
David van Moolenbroek [Mon, 19 Aug 2013 22:49:07 +0000 (00:49 +0200)]
test55: add tests for getvfsstat(2)

Change-Id: Idc3da4137494db836590c71414017832f15a2628

10 years agoImplement support for [f]statvfs1(2) 33/933/2
David van Moolenbroek [Mon, 19 Aug 2013 23:28:23 +0000 (01:28 +0200)]
Implement support for [f]statvfs1(2)

The [f]statvfs(3) calls now use [f]statvfs1(2).

Change-Id: I949c177fc14abf976e45165c342f897f4ec988ee

10 years agoImplement support for getvfsstat(2) 32/932/2
David van Moolenbroek [Mon, 19 Aug 2013 23:39:47 +0000 (01:39 +0200)]
Implement support for getvfsstat(2)

Change-Id: I99b697919d411c57105de561105beefc7d1d309a

10 years agoRedo mount(2)/umount(2) ABI 31/931/2
David van Moolenbroek [Mon, 19 Aug 2013 23:37:18 +0000 (01:37 +0200)]
Redo mount(2)/umount(2) ABI

- pass in file system type through mount(2), and return this type in
  statvfs structures as generated by [f]statvfs(2);
- align mount flags field with NetBSD's, splitting out service flags
  which are not to be passed to VFS;
- remove limitation of mount ABI to 16-byte labels, so that labels
  can be made larger in the future;
- introduce new m11 message union type for mount(2) as side effect.

Change-Id: I88b7710e297e00a5e4582ada5243d3d5c2801fd9

10 years agoAlign "struct statvfs" with NetBSD 30/930/2
David van Moolenbroek [Mon, 19 Aug 2013 23:35:35 +0000 (01:35 +0200)]
Align "struct statvfs" with NetBSD

This is a requirement for implementing calls such as getmntinfo(3).
VFS is now responsible for filling in some of the structure's fields.

Change-Id: I0c1fa78019587efefd2949b3be38cd9a7ddc2ced

10 years agoVFS/FS: remove fstatfs(2) and REQ_FSTATFS 29/929/2
David van Moolenbroek [Mon, 19 Aug 2013 22:55:49 +0000 (00:55 +0200)]
VFS/FS: remove fstatfs(2) and REQ_FSTATFS

The fstatfs(3) call now uses fstatvfs(2).

Change-Id: I3fa5d31f078457b4d80418c23060bb2c148cb460

10 years agousr.bin/stat Update 28/928/2
Lionel Sambuc [Fri, 19 Apr 2013 11:16:51 +0000 (13:16 +0200)]
usr.bin/stat Update

Change-Id: I029160c73baab1b3465bc5397a36c55886db225b

10 years agoalmost aligned ioctl prototype 27/927/2
Lionel Sambuc [Fri, 19 Apr 2013 07:54:51 +0000 (09:54 +0200)]
almost aligned ioctl prototype

Change-Id: I7f3eaa99d2a9767f71e8387cea5c7f56dcb28f99

10 years agoABI Break: aligning struct termios 26/926/2
Lionel Sambuc [Fri, 19 Apr 2013 07:54:09 +0000 (09:54 +0200)]
ABI Break: aligning struct termios

Change-Id: I0109188fffbb166a5036e324a4a75b2491c39fb3

10 years ago32 to 64 bits fsblkcnt_t and fsfilcnt_t. 25/925/2
Lionel Sambuc [Thu, 18 Apr 2013 12:42:15 +0000 (14:42 +0200)]
32 to 64 bits fsblkcnt_t and fsfilcnt_t.

Change-Id: I432229143c85cd178262b802a76ac606801ac59a

10 years agomoving prototypes to lib.h 24/924/2
Lionel Sambuc [Thu, 18 Apr 2013 09:08:16 +0000 (11:08 +0200)]
moving prototypes to lib.h

Change-Id: If53d3f5ee761b10e0f3d4346a0c5b39ba7901c65

10 years agostruct uucred 23/923/2
Lionel Sambuc [Thu, 18 Apr 2013 09:07:44 +0000 (11:07 +0200)]
struct uucred

Change-Id: Ia97cb6c38bb566be30d568a252ae7b76142a21dd

10 years agoAlignement on netbsd types, part 1 22/922/2
Lionel Sambuc [Tue, 16 Apr 2013 09:48:54 +0000 (11:48 +0200)]
Alignement on netbsd types, part 1

The following types are modified (old -> new):
 * _BSD_USECONDS_T_ int       -> unsigned int
 * __socklen_t      __int32_t -> __uint32_t
 * blksize_t        uint32_t  -> int32_t
 * rlim_t           uint32_t  -> uint64_t
On ARM:
 * _BSD_CLOCK_T_    int       -> unsigned int
On Intel:
 * _BSD_CLOCK_T_    int       -> unsigned long

bin/cat is also updated in order to fix warnings.

_BSD_TIMER_T_ has still to be aligned.

Change-Id: I2b4fda024125a19901120546c4e22e443ba5e9d7

10 years agoAdapt the type used for adjtime_delta 21/921/2
Lionel Sambuc [Fri, 23 Aug 2013 18:27:27 +0000 (20:27 +0200)]
Adapt the type used for adjtime_delta

clock_t is currently a signed type, but in NetBSD this is not the
case. As we plan on aligning our types we have to change this as this
prevents negative delta from being correctly used.

Change-Id: I9bccdee2b41626b0262471dc1900de505a1991a7

10 years agofix sysroot clang 20/920/2
Lionel Sambuc [Wed, 17 Apr 2013 11:01:55 +0000 (13:01 +0200)]
fix sysroot clang

Change-Id: I63adf8460e7fdbe3d9d5ad6c828ae5758cb1643c

10 years agoBumping version to 3.3.0 19/919/2
Lionel Sambuc [Wed, 3 Apr 2013 08:45:55 +0000 (08:45 +0000)]
Bumping version to 3.3.0

Change-Id: I4c88bdd449daf6ad3fe4e93ee8fc35d4f38becc4

10 years agoVFS: use 64-bit file offsets in all requests 18/918/2
Thomas Veerman [Mon, 25 Mar 2013 16:08:04 +0000 (16:08 +0000)]
VFS: use 64-bit file offsets in all requests

Change-Id: I735c4068135474aff2c397f4bc9fb147a618b453

10 years agostat.h: remove some big_ types 17/917/2
Thomas Veerman [Thu, 7 Mar 2013 15:55:22 +0000 (15:55 +0000)]
stat.h: remove some big_ types

Change-Id: I84017db3d54edfb823cc52e02d0b07fccb003988

10 years agoDefine protocol version of {mode,ino,uid,gid}_t 16/916/2
Thomas Veerman [Thu, 7 Mar 2013 14:46:21 +0000 (14:46 +0000)]
Define protocol version of {mode,ino,uid,gid}_t

Change-Id: Ia2027749f2ce55a561d19eb895a5618505e9a2ac

10 years agoVFS-FS protocol: add versioning 15/915/2
Thomas Veerman [Mon, 25 Mar 2013 21:09:10 +0000 (21:09 +0000)]
VFS-FS protocol: add versioning

Change-Id: Ice6fbfd4b535b7435653fa08b27a3378d1cfdbf8

10 years agomined: fix dangling else 27/1427/1
Thomas Cort [Sun, 16 Feb 2014 20:08:20 +0000 (20:08 +0000)]
mined: fix dangling else

Add braces to avoid ambiguity. Resolves the following warning:
mined1.c:1355:5: warning: add explicit braces to avoid dangling else
[-Wdangling-else]

Change-Id: I64e2942835e45869010f0b8bbef2fe880d0852dc

10 years agozmodem: K&R -> ANSI C function declaration 08/1208/4
Melon [Mon, 27 Jan 2014 17:13:42 +0000 (18:13 +0100)]
zmodem: K&R -> ANSI C function declaration

Change-Id: Id3dbd2e39563cb399da9ad86bdd0024676f9d728

10 years agoarm-refactor:document ARM assembly code. 25/1425/1
Kees Jongenburger [Mon, 10 Feb 2014 12:12:21 +0000 (13:12 +0100)]
arm-refactor:document ARM assembly code.

Change-Id: I8540a09cdaf45431ad163954ce41d36f4b72cad5

10 years agoarm:replace ifdef's by runtime checks in the omap rtc driver. 24/1424/1
Kees Jongenburger [Mon, 10 Feb 2014 11:20:28 +0000 (12:20 +0100)]
arm:replace ifdef's by runtime checks in the omap rtc driver.

Change-Id: I038f0fcf88061ae60d6d029d86c84153bf0f0020

10 years agoarm:replace ifdef's by runtime checks in the lan8710a driver. 23/1423/1
Kees Jongenburger [Mon, 10 Feb 2014 11:19:33 +0000 (12:19 +0100)]
arm:replace ifdef's by runtime checks in the lan8710a driver.

Change-Id: I1f345240b88362658e987a85f1642324471119c3

10 years agoarm:create SoC specific bsp directory and move code to there. 22/1422/2
Kees Jongenburger [Fri, 7 Feb 2014 07:46:29 +0000 (08:46 +0100)]
arm:create SoC specific bsp directory and move code to there.

Created a new directory called bsp (board support package) to hold
board or system on chip specific code. The idea is the following.

Change-Id: Ica5886806940facae2fa5492fcc938b3c2b989be

10 years agoarm-refactor:use sysenv board to determine what driver to start. 07/1207/1
Kees Jongenburger [Fri, 10 Jan 2014 11:20:59 +0000 (12:20 +0100)]
arm-refactor:use sysenv board to determine what driver to start.

Change-Id: Ib2f273a4ff666a7417a13e39be0b89075f61c31b

10 years agoarm:fix GPIO revision check on DM37XX. 06/1206/1
Kees Jongenburger [Fri, 10 Jan 2014 11:00:13 +0000 (12:00 +0100)]
arm:fix GPIO revision check on DM37XX.

The GPIO revision check assumed the major and minor revision numbers where
located at same location in the register. This is not true.

Change-Id: Ieaff07ed8a19e6b4cf1d121a41d3290880b78a82

10 years agotest24: fix memory leak. 05/1205/1
Thomas Cort [Tue, 14 Jan 2014 03:22:25 +0000 (22:22 -0500)]
test24: fix memory leak.

Local variable 'name' was allocated but not freed. Add the free().

Change-Id: I3d16486fc17bd40d54619d80e5b1fdfe96f1be26

10 years agoVM bugfix & regression test 02/1202/4
Ben Gras [Wed, 8 Jan 2014 16:43:19 +0000 (17:43 +0100)]
VM bugfix & regression test

The bug in the offset correction code for the 'shrink region from
below' case can easily case an assert(foundregion->offset == offset)
to trigger (if the blocks are touched afterwards, e.g. on fork())
as the offsets become wrong. This commit is a fix & regression test.

Change-Id: I28ed403e3891362a2dea674a49e786d3450d2983

10 years agoarm:indenting 99/1199/4
Kees Jongenburger [Tue, 17 Dec 2013 15:20:37 +0000 (16:20 +0100)]
arm:indenting

Change-Id: I2f8f664fa4c66649db8981e58e6bb7a6f533df5a

10 years agoarm:disable filemmap. 98/1198/2
Kees Jongenburger [Tue, 17 Dec 2013 13:42:06 +0000 (14:42 +0100)]
arm:disable filemmap.

We currently have a few of the POSIX tests failing because filemmap
is enabled by default. The working assumption is that these program
pass a pointer to the file server that points to a not yet loaded
data segment. When the file server tries to access that data it
therefore generates a pagefault and a call to itself it can not
handle because it is unable to first return the current call.

Change-Id: Ic1a2d9cd0a542bd950e2b08accb61cfe2855c5a3

10 years agoarm:refactor move pagetable to the common directory. 97/1197/1
Kees Jongenburger [Tue, 17 Dec 2013 13:41:35 +0000 (14:41 +0100)]
arm:refactor move pagetable to the common directory.

Change-Id: Ic3178241f86156f729f016017f61017653ddbd23

10 years agoarm:make the kernel server and driver binaries identical. 94/1194/3
Kees Jongenburger [Fri, 13 Dec 2013 13:46:56 +0000 (14:46 +0100)]
arm:make the kernel server and driver binaries identical.

Make the kernel server and driver binaries indentical for the different
ARM platforms. We no longer need to define the AM335X or DM37XX flags
during compilation. The remaining differences are all located in u-boot.

Change-Id: I14ac60837dd2d7f116bc5fa56d3989b48d7c4fea

10 years agoarm:replace ifdef's by runtime checks in the i2c driver. 93/1193/3
Kees Jongenburger [Fri, 13 Dec 2013 13:16:29 +0000 (14:16 +0100)]
arm:replace ifdef's by runtime checks in the i2c driver.

Change-Id: I5cdff48d8be9bbe5a4734192b451dc45983fbef2

10 years agoarm:switch to dynamic configuration for the kernel. 92/1192/3
Kees Jongenburger [Fri, 13 Dec 2013 13:12:50 +0000 (14:12 +0100)]
arm:switch to dynamic configuration for the kernel.

During startup machine.board_id is now determined. The kernel can now
at runtime determine how to configure itself and does so.

Change-Id: I4f615af9bfa5add219e618b911a51af127591d6a

10 years agoarm:determine board_id using bootargs.board_name 91/1191/2
Kees Jongenburger [Fri, 13 Dec 2013 13:00:06 +0000 (14:00 +0100)]
arm:determine board_id using bootargs.board_name

On startup determine the board_id based on the board name
passed from u-boot. This code also export "board" for use
by  userland using sysenv.

Change-Id: I1064a49497c82b06f50d98650132bc0a7f543568

10 years agoarm:refactor replace cmdline.txt by bootargs passed to the kernel. 96/1196/1
Kees Jongenburger [Fri, 13 Dec 2013 10:18:02 +0000 (11:18 +0100)]
arm:refactor replace cmdline.txt by bootargs passed to the kernel.

Put the boot arguments in uEnv.txt and not in cmdline.txt to allow
a more dynamic configuration of the system. We now also pass the
u-boot board_name parameter to the kernel.

10 years agoarm:manage versioning of u-boot and upgrade u-boot 95/1195/1
Kees Jongenburger [Fri, 13 Dec 2013 12:36:47 +0000 (13:36 +0100)]
arm:manage versioning of u-boot and upgrade u-boot

Replaced the wget download of u-boot by a versioned git checkout
this allows us to better manage the u-boot and MLO version we ship
while still allowing us to build ofline.

This changes replaces the BASE_URL setting by U_BOOT_BIN_DIR and
also updates to a newer build of u-boot.

10 years agokernel:export board to userland. 82/1182/4
Kees Jongenburger [Fri, 29 Nov 2013 13:31:31 +0000 (14:31 +0100)]
kernel:export board to userland.

Export the board variable to userland using sysenv. This
allows rc-scrips to perform device specific initialisation.

The board variable follows the following pattern

[ARCH]-[ARCHVARIANT]-[VENDOR]-[BOARD]-[BOARDVARIANT]

We currently we support the following boards:
X86-I586-GENERIC-GENERIC-GENERIC
ARM-ARMV7-TI-BBXM-GENERIC
ARM-ARMV7-TI-BB-WHITE
ARM-ARMV7-TI-BB-BLACK

Change-Id: I9e5f5f24f9a71cc9797cacb1aafb19499613f0be

10 years agoarm:replace ifdef's by runtime checks. 81/1181/4
Kees Jongenburger [Fri, 29 Nov 2013 13:27:03 +0000 (14:27 +0100)]
arm:replace ifdef's by runtime checks.

Change-Id: Iff966f2214e2d8bb6b72dd0a119085709f2d4a9c

10 years agoarm:add board_id to machine to enable runtime configuration. 80/1180/3
Kees Jongenburger [Fri, 29 Nov 2013 13:19:42 +0000 (14:19 +0100)]
arm:add board_id to machine to enable runtime configuration.

Modified the machine struct in include/minix/type.h to have an
additional field called board_id. This fields can be read out
by userland and drivers at runtime to enable automatic
configuration. The board_id field contains information about
the hardware architecture / board and such.

Change-Id: Ib12bc0d43fc9dbdb80ee0751c721ee516de1d2d6

10 years agocommands/crc: changed K&R to ANSI style 86/1186/1
Beletti [Wed, 20 Nov 2013 22:43:51 +0000 (22:43 +0000)]
commands/crc: changed K&R to ANSI style

Change-Id: Ia63ccbb76e00f18adea414296caef39a3fdf3a39

10 years agocommands/decomp16: changed K&R to ANSI style 85/1185/1
Beletti [Wed, 20 Nov 2013 21:55:11 +0000 (21:55 +0000)]
commands/decomp16: changed K&R to ANSI style

Change-Id: Ibefd50187bcc87a24d7c4c895524be9fa55f493a

10 years agocommands/devsize: changed K&R to ANSI style 84/1184/1
Beletti [Wed, 20 Nov 2013 21:48:20 +0000 (21:48 +0000)]
commands/devsize: changed K&R to ANSI style

Change-Id: Idc9eda4a9134c4d85870d502075398eb66c298f7

10 years agocommands/chown: changed to K&R to ANSI style 74/1174/4
Beletti [Tue, 19 Nov 2013 02:16:15 +0000 (02:16 +0000)]
commands/chown: changed to K&R to ANSI style

Change-Id: I6a956e6479b6ebedca74fdd96e44756f00633cc4

10 years agocommands/chmod: changed K&R to ANSI style 73/1173/4
Beletti [Tue, 19 Nov 2013 01:49:35 +0000 (01:49 +0000)]
commands/chmod: changed K&R to ANSI style

Change-Id: If22f201dec8b34c8773910448d75b6d8256ee6a4

10 years agocommands/at: changed K&R to ANSI style 72/1172/4
Beletti [Tue, 19 Nov 2013 01:30:55 +0000 (01:30 +0000)]
commands/at: changed K&R to ANSI style

Change-Id: Ifb12349bcf456ff303c15fdedda4ab853a148aff

10 years agocommands/synctree: changed K&R to ANSI style 71/1171/4
Beletti [Tue, 19 Nov 2013 00:48:58 +0000 (00:48 +0000)]
commands/synctree: changed K&R to ANSI style

Change-Id: I8667de0157ac3caa14e06f788daf62d6ed92b59c

10 years agoadd two missing files to flist 78/1178/3
Ben Gras [Mon, 25 Nov 2013 13:07:42 +0000 (13:07 +0000)]
add two missing files to flist

Change-Id: Ib5b62d603fbd57c4604f4613db1a2a5d485a8133

10 years agorun: allow scripts to be run as root 79/1179/2
Ben Gras [Thu, 28 Nov 2013 09:52:15 +0000 (09:52 +0000)]
run: allow scripts to be run as root

Forward-port of the run script change in the testvnd
commit on the 3.3.0 branch by David.

Needed to cleanly run the testisofs test as root in
the Jenkins environment.

'While here,' also fix messy which output in testsh2.

Change-Id: I6ec472e1386a54ae74b6e55394f01fa7c5ce53a9

10 years agotestmfs, testisofs: MFS format, ISO functionality 64/1164/4
Ben Gras [Tue, 19 Nov 2013 16:01:23 +0000 (16:01 +0000)]
testmfs, testisofs: MFS format, ISO functionality

testmfs: catch MFS format changes

This test tests mkfs.mfs will generate the same FS image given the same
input files. mkproto creates a proto file (normalizing directory entry
order). The assumption is that a change in the output flags a tacit
change in FS format, and that a FS format change will cause the image
to change.

        . Changes to mkfs.mfs that innocently change the format can
          change the sha1 output in the script along with it.
        . The assumption is that corresponding versions of mkfs.mfs and
          MFS will always work together; otherwise a lot breaks (ramdisk etc.)
        . Therefore, as long as a generated FS image stays the same with the
          same input now, incompatible MFS changes will still be flagged,
          even if they work together with the current mkfs.mfs.

testisofs: test ISO filesystem

        . to test isofs: prepare an ISO FS image using writeisofs, copy it
          to a RAM device, mount it using the iso9660fs server, compare the
          SHA1 contents of the files on the ISO with the inputs.
        . use su to run certain commands in the script as root

run script: run shell script tests

. they are installed without .sh so should be
  searched for as such
. add diagnostic when tests are skipped

Change-Id: I30daff58e1e43903dacf3c99996a4a0e7d819b6b

10 years agolibminixfs: allow non-pagesize-multiple FSes 63/1163/3
Ben Gras [Tue, 19 Nov 2013 15:59:52 +0000 (15:59 +0000)]
libminixfs: allow non-pagesize-multiple FSes

The memory-mapped files implementation (mmap() etc.) is implemented with
the help of the filesystems using the in-VM FS cache. Filesystems tell it
about all cached blocks and their metadata. Metadata is: device offset and,
if any (and known), inode number and in-inode offset. VM can then map in
requested memory-mapped file blocks, and request them if necessary.

A limitation of this system is that filesystem block sizes that are not
a multiple of the VM system (and VM hardware) page size are not possible;
we can't map blocks in partially. (We can copy, but then the benefits of
mapping and sharing the physical pages is gone.) So until before this
commit various pieces of caching code assumed page size multiple
blocksizes. This isn't strictly necessary as long as mmap() needn't be
supported on that FS.

This change allows the in-FS cache code (libminixfs) to allocate any-sized
blocks, and will not interact with the VM cache for non-pagesize-multiple
blocks. In that case it will also signal requestors, by failing 'peek'
requests, that mmap() should not be supported on this FS. VM and VFS
will then gracefully fail all file-mapping mmap() calls, and exec() will
fall back to copying executable blocks instead of mmap()ping executables.

As a result, 3 diagnostics that signal file-mapped mmap()s failing
(hitherto an unusual occurence) are disabled, as ld.so does file-mapped
mmap()s to map in objects it needs. On FSes not supporting it this situation
is legitimate and shouldn't cause so much noise. ld.so will revert to its own
minix-specific allocate+copy style of starting executables if mmap()s fail.

Change-Id: Iecb1c8090f5e0be28da8f5181bb35084eb18f67b

10 years agoiso9660fs fix 62/1162/1
Ben Gras [Tue, 19 Nov 2013 15:59:33 +0000 (15:59 +0000)]
iso9660fs fix

Change-Id: Iea91c2932ff5b0141d5eeffc5bac17632ac6b94d

10 years agomkfs.mfs, mkproto: minor features 61/1161/1
Ben Gras [Tue, 19 Nov 2013 15:58:05 +0000 (15:58 +0000)]
mkfs.mfs, mkproto: minor features

. mkfs.mfs: -T option to set timestamp of files on FS
. mkproto: normalize (sort) order of directory entries
. mkproto bugfix: always print mode in 3 digits (%03o)

Change-Id: Ice06d5f05500cd2ac9b063156c340b8f78fe6441

10 years agoImporting usr.bin/colcrt 59/1159/1
Thomas Cort [Tue, 19 Nov 2013 11:46:36 +0000 (06:46 -0500)]
Importing usr.bin/colcrt

Replaces colcrt from commands/cawf.
No Minix-specific changes needed.

Change-Id: I0ec6452c879b9a844ad97e89759087d6c3e740a2

10 years agoImporting usr.bin/mkfifo 57/1157/2
Thomas Cort [Mon, 18 Nov 2013 21:40:55 +0000 (16:40 -0500)]
Importing usr.bin/mkfifo

Replaces commands/mkfifo. No Minix-specific changes needed.

Change-Id: Idb20430d4297c7011fb7e2ef6b0876ebb2776c1c

10 years agousr.bin/calendar: re-sync with upstream. 58/1158/1
Thomas Cort [Mon, 18 Nov 2013 23:00:57 +0000 (18:00 -0500)]
usr.bin/calendar: re-sync with upstream.

Jenkins was failing on usr.bin/calendar/calendar.c:386:6: with
"error: 'fd' may be used uninitialized in this function"
when the level of error checking was turned up.

The error was recently fixed upstream. This commit updates
calendar.c to upstream rev 1.50, updates calendar files too.

Change-Id: Ibe0695bf5d0315972f2a4fb1175219dd12cbfa5a

10 years agoImporting usr.bin/soelim 56/1156/1
Thomas Cort [Mon, 18 Nov 2013 13:49:16 +0000 (08:49 -0500)]
Importing usr.bin/soelim

No Minix-specific changes needed.

Change-Id: Ie313f3a4ade21c9f5edabd55726fa6af5f468e5d

10 years agocommands/backup: changed K&R to ANSI style 53/1153/2
Beletti [Sat, 16 Nov 2013 19:11:06 +0000 (19:11 +0000)]
commands/backup: changed K&R to ANSI style

Change-Id: I6ec2eebc0ad575125f2fa9df5bee232151eaf0eb

10 years agosetup: correction for file/kb counting 54/1154/1
Ben Gras [Mon, 18 Nov 2013 10:25:30 +0000 (10:25 +0000)]
setup: correction for file/kb counting

Change-Id: I74cadcf681fdda105a85535a208251b09981e383

10 years agocommands/fix: change K&R to ANSI style. 52/1152/2
Beletti [Sat, 16 Nov 2013 02:52:10 +0000 (02:52 +0000)]
commands/fix: change K&R to ANSI style.

Change-Id: I0a6d7e39e95a157a80567aeea90f8fa4a188ee7d

10 years agoImporting usr.bin/checknr 50/1150/1
Thomas Cort [Thu, 14 Nov 2013 12:33:51 +0000 (07:33 -0500)]
Importing usr.bin/checknr

No Minix-specific changes needed.

Change-Id: I22fc8fdee158b00bf93c5455b2b2409d7cff4e05

10 years agoImporting usr.bin/ul 49/1149/1
Thomas Cort [Wed, 13 Nov 2013 12:42:20 +0000 (07:42 -0500)]
Importing usr.bin/ul

No Minix-specific changes needed.

Change-Id: I7b8f970b8b2bbdeb5cf88ab5163d1a80c4279c4b

10 years agoReplaced add64, add64u and add64ul with operators. 40/1140/2
Gerard [Mon, 11 Nov 2013 18:17:03 +0000 (19:17 +0100)]
Replaced add64, add64u and add64ul with operators.

Change-Id: Ia537f83e15cb686f1b81b34d73596f4298b0a924

10 years agoImporting usr.bin/deroff 47/1147/1
Thomas Cort [Wed, 13 Nov 2013 00:03:55 +0000 (19:03 -0500)]
Importing usr.bin/deroff

No Minix-specific changes needed.

Change-Id: I87c3629238b7bfdbff3b64682fcdb245a7ce740c

10 years agoarm_sdimage.sh: use insert-fs feature 39/1139/4
Ben Gras [Mon, 11 Nov 2013 15:32:35 +0000 (16:32 +0100)]
arm_sdimage.sh: use insert-fs feature

Change-Id: Ie8bcbca26d5f530e03dbcb7e55771c5cd29d29f3

10 years agoImporting usr.bin/fpr 46/1146/1
Thomas Cort [Tue, 12 Nov 2013 19:11:32 +0000 (14:11 -0500)]
Importing usr.bin/fpr

No Minix-specific changes needed.

Change-Id: I2169284c68309de78d89d9f3c678f340ff066c7e

10 years agoImporting usr.bin/id 45/1145/1
Thomas Cort [Tue, 12 Nov 2013 13:40:59 +0000 (08:40 -0500)]
Importing usr.bin/id

Replaces commands/id. No Minix-specific changes needed.

Change-Id: I307ae0fa3f41ade398ee9be12c1b4d78e8b59e95

10 years agoImporting lib/libform 44/1144/1
Thomas Cort [Tue, 12 Nov 2013 12:56:07 +0000 (07:56 -0500)]
Importing lib/libform

No Minix-specific changes needed.

Change-Id: Ia8ddbdb57ac04dfb42d79c374b9e25b189f9dc3b

10 years agoImporting lib/libmenu 43/1143/1
Thomas Cort [Tue, 12 Nov 2013 12:39:59 +0000 (07:39 -0500)]
Importing lib/libmenu

No Minix-specific changes needed.

Change-Id: Ifab9a44bd401aebf99ab019697937620d88d47de

10 years agoImporting usr.bin/calendar 41/1141/1
Thomas Cort [Mon, 11 Nov 2013 15:52:51 +0000 (10:52 -0500)]
Importing usr.bin/calendar

No Minix-specific changes needed.

Change-Id: I9e68983104efb20ab8e946df3bce189d99ab2deb

11 years agoeepromread: support for reading from /dev/eeprom 38/1138/1
Thomas Cort [Sun, 10 Nov 2013 17:06:27 +0000 (12:06 -0500)]
eepromread: support for reading from /dev/eeprom

eepromread could only read EEPROMs through the /dev/i2c interface.
Once the cat24c256 driver is started and claims/reserves the
device, it can no longer be read through the /dev/i2c interface.

This patch adds support for reading from EEPROMs through the
/dev/eeprom interface. For example, to read the on-board eeprom
on the BBB, one would do `eepromread -f /dev/eepromb1s50 -i`.

Change-Id: If08ce37231e593982eeb109bdd6d5458ad271108

11 years agoImporting usr.sbin/unlink 27/1127/4
Thomas Cort [Thu, 7 Nov 2013 03:08:33 +0000 (22:08 -0500)]
Importing usr.sbin/unlink

No Minix-specific changes needed

Change-Id: Iab2345f6a661e1c1f21f8ae1a414b88762de26fc

11 years agoImporting usr.sbin/link 26/1126/4
Thomas Cort [Thu, 7 Nov 2013 03:06:17 +0000 (22:06 -0500)]
Importing usr.sbin/link

No Minix-specific changes needed

Change-Id: If202c617d5fa72b1c4ad5515637cdc0ee6f2d6ca

11 years agomkfs.mfs -I: insert fs at offset feature 25/1125/7
Ben Gras [Thu, 7 Nov 2013 07:33:39 +0000 (08:33 +0100)]
mkfs.mfs -I: insert fs at offset feature

. use it in x86_hdimage.sh:
  avoid copying big FS images into iso & hd images each time

Change-Id: I0775f43cd1821ea7be2fec5b96d107a68afb96d6

11 years agox86_hdimage.sh -i: crossbuild x86 release CD 07/1107/7
Ben Gras [Tue, 5 Nov 2013 14:43:44 +0000 (15:43 +0100)]
x86_hdimage.sh -i: crossbuild x86 release CD

        . build writeisofs as a native tool too for it
        . also mkfs.mfs: make missing file in proto nonlethal
        . make setup script a little more self-sufficient
        . hdboot: use INSTALL_FILE instead of INSTALL so that the
          results get added to the METALOG

Change-Id: Id233e4c861f81046bf6c4be0510b8a3bf39ff9be

11 years agolibminixfs: fix buf leak 06/1106/6
Ben Gras [Tue, 5 Nov 2013 14:43:27 +0000 (15:43 +0100)]
libminixfs: fix buf leak

. mfs: add asserts to catch similar problems in the future

Change-Id: I939230b8d63f100ac071696425b35496b2169bc4