aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/lib/sys.c
Commit message (Collapse)AuthorAgeFilesLines
* mini-os: implement poll(2)Wei Liu2013-04-111-1/+116
| | | | | | | | It is just a wrapper around select(2). This implementation mimics Linux's do_poll. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* minios: fix bug in lseek for mini-osMatthew Fioravante2012-11-191-29/+38
| | | | | | | | | | lseek always used files[fd].file.offset. It should use the offset of whatever union member is actually being used. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* minios: add tpmfront, tpm_tis, and tpmback driversMatthew Fioravante2012-11-131-0/+48
| | | | | | | | | | | | | | | | | | | | This patch adds 3 new drivers to mini-os. tpmfront - paravirtualized tpm frontend driver tpmback - paravirtualized tpm backend driver tpm_tis - hardware tpm driver Unfortunately these drivers were derived from GPL licensed linux kernel drivers so they must carry the GPL license. However, since mini-os now supports conditional compilation, hopefully these drivers can be included into the xen tree and conditionally removed from non-gpl projects. By default they are disabled in the makefile. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* minios: add posix io for blkfrontMatthew Fioravante2012-10-091-2/+44
| | | | | | | | | This patch adds posix io support (read,write,lseek) to block devices using blkfront. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* minios: add CONFIG_XC conditionalMatthew Fioravante2012-10-081-1/+6
| | | | | | | | | This patch adds a CONFIG_XC option to mini-os, to allow conditional support for libxc for mini-os domains. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* nstore: rename public xenstore headersIan Campbell2012-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | The xenstore header xs.h is producing conflicts with other software[1]. xs is a too short identifier and does not matche the library. Renaming the headers to xenstore.h and xenstore_lib.h is the easiest way to make them easy recognizable and prevent furthe problems. [1]: http://bugs.debian.org/668550 [ Also update QEMU_TAG, to bring in corresponding change to qemu-xen-traditional. -iwj ] Signed-off-by: Bastian Blank <waldi@debian.org> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> --HG-- rename : tools/xenstore/xs.h => tools/xenstore/xenstore.h rename : tools/xenstore/xs_lib.h => tools/xenstore/xenstore_lib.h
* mini-os: make frontends and xenbus optionalDaniel De Graaf2012-02-091-0/+59
| | | | | | | | | | | | | | | | | This adds compile-time logic to disable certain frontends in mini-os: - pcifront is disabled by default, enabled for ioemu - blkfront, netfront, fbfront, kbdfront, consfront are enabled by default - xenbus is required for any frontend, and is enabled by default If all frontends and xenbus are disabled, mini-os will run without needing to communicate with xenstore, making it suitable to run the xenstore daemon. The console frontend is not required for the initial console, only consoles opened via openpt or ptmx. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* mini-os: use BSD sys/queue.h instead of Linux list.hIan Campbell2012-01-311-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latter is GPL which makes the whole of mini-os GPL rather than BSD as intended. In tree users are all GPL or GPL-compatible but we should fix this so that mini-os is BSD. Do so by using the same BSD sys/queue.h as we use in libxl. Tested with the builtin mini-os test app and qemu stubdomain, both of which appear to still function as expected. Move tools/libxl/external and the associated sed script to tools/include/xen-external to allow more sensible access from mini-os. Also add s/NULL/0/ in the sed script due to NULL not always being defined in stubdom code when mini-os/wait.h is included. As well as the obvious ABI changes there are a few API updates associated with the change: - struct rw_semaphore.wait_list is unused - remove_waiter needs to take the wait_queue_head The latter requires a qemu update, so there is also a QEMU_TAG update in this changeset. I sprinkled some extra-emacs local variables around the files I edited which didn't have them. I think this should be backported to the stable branches since external users of mini-os may have been mislead into thinking they could safely link mini-os against GPL-incompatible code. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* minios: Fix bug/build problem introduced in c/s 22799John Weekes2011-01-271-3/+3
| | | | | | | | With "debug=n", "make stubdom" currently fails in xen-unstable. This patch addresses this through minor fixups. Signed-off-by: John Weekes <lists.xen@nuclearfallout.net> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl, minios: stubdom console based save/restoreStefano Stabellini2011-01-211-1/+38
| | | | | | | | | | | | | | | | Add two "special" PV consoles to stubdoms that are going to be used to send and receive the qemu-xen save files on save/restore. Use the second PV console to send the qemu-xen save file and the third PV console to receive the qemu-xen save file on restore. Fix the console shutdown function free_consfront that is called when the qemu save file is closed. Stubdom save/restore is still broken with xend. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: remove fs-front/fs-backTim Deegan2011-01-111-208/+13
| | | | | | | | | | | | | | | | Its access controls are really not OK. In particular, it's not good for libxl, which stores per-VM config blobs in a directory that is exported to all VMs. This will break stub-qemu save/restore, which is the only user of fs-front that I'm aware of, but: - It's currently broken anyway (fs-back isn't run by default and crashes if it is run manually); and - Stefano has a plan to plumb qemu save records through a dedicated console channel instead. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* minios: reverse layering of xc vs minios fd closeKeir Fraser2010-12-031-7/+6
| | | | | | | | | | | | Having minios close() call back into the libxc core close routines is backwards and unexpected. On every other OS the libxc core close routine calls close(). Export minios specific functions from the minios libxc code to implement fd closing for each type of xc file handle and simply call close() in the core close routine. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-2/+3
| | | | | | | | | | | | | | | | | | | | This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* minios: implement xc_map_foreign_bulkKeir Fraser2010-01-181-2/+2
| | | | | | | In order to do so it modifies map_frames_ex and do_map_frames to take an int *err as parameter and return any error that way. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: Optimize mmap(open("/dev/mem"))Keir Fraser2009-10-231-5/+2
| | | | | | | Set map_frames_ex's stride parameter to 0 and increment to 1 to avoid building an explicit list of mfns. Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
* stubdom: mmap on /dev/mem supportKeir Fraser2009-10-211-1/+11
| | | | | | | | | | This patch adds support for mmap on /dev/mem in a stubdom; it is secure because it only works for memory areas that have been explicitly allowed by the toolstack (xc_domain_iomem_permission). Incidentally this is all that is needed to make MSI-X passthrough work with stubdoms. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: switch to C99 integer typesKeir Fraser2009-07-151-1/+1
| | | | | | This is a necessary step to make minios build on NetBSD. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* minios: Use posix_openpt() rather than non-standard openpty().Keir Fraser2009-06-181-2/+9
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: support secondary guest consoles.Keir Fraser2009-06-171-3/+19
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: Implement some extra lib functions for ocaml xenstored stubdomKeir Fraser2009-05-191-0/+32
| | | | | | | We could stub them out as unsupported, but we may as well implement them as they are very simple. Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
* minios: Define extra stub functions to allow build of ocaml xenstored stubdomKeir Fraser2009-05-191-1/+58
| | | | | | | These are referenced by the libs that ocamlopt links xenstored to, but ought not actually get called. Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
* stubdom: drop lwip supportKeir Fraser2009-04-231-7/+9
| | | | | | | | | | | | | | | | | | | | Network support is still provided the same way: using the tap interface, created in qemu using netfront. The lwip stack is still available to avoid additional compilation issues. However the stubdom is not going to have its own vif anymore, this means that the only vnc server supported is the one in dom0. You can still enable the vnc server in a stubdom at compile time, if you want so. Probably the most important change caused by this patch to xen users is that you don't have to specify two vif in the stubdom config file anymore, but just one: -vif = [ '', 'ip=10.0.1.1,mac=aa:00:00:12:23:34'] +vif = ['ip=10.0.1.1,mac=aa:00:00:12:23:34'] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* minios: add ioremap/iounmapKeir Fraser2009-03-021-37/+5
| | | | | | | | Add ioremap and iounmap functions to minios. Also move some unmapping code from and clean up mem_test. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* minios: add a barebone net/if.hKeir Fraser2008-11-111-0/+7
| | | | | | | | net/if.h is a standard header but unfortunately lwip doesn't provide it for any target but linux. Therefore I am adding a net/if.h, with an empty implementation of the declared functions. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* mini-os: adding some missing posix function declarationsKeir Fraser2008-09-171-0/+1
| | | | | | | Adding some missing posix function declarations, to get rid of some qemu-remote compile time warnings. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* stubdom: fix munmap's update_va_mapping flag passing, thus fixingKeir Fraser2008-08-281-4/+7
| | | | | | INVLPG passing Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: add v?errx? and v?warnx? functionsKeir Fraser2008-08-271-0/+62
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* mini-os: Fix build failure with void* arithmetic.Keir Fraser2008-08-271-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom: make munmap work in batches to fix stack overflowKeir Fraser2008-08-271-22/+32
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: add syslog functionsKeir Fraser2008-08-271-0/+28
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: turn off_t 64bit on x86Keir Fraser2008-08-081-9/+0
| | | | | | | | We can decide to make off_t 64bit instead of implementing the LFS tricks. Name corresponding functions foo64 to permit simple caml programs linking. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* FSIF: extend protocol to multi-grant requests and multi-page ringKeir Fraser2008-08-011-4/+4
| | | | | | | To improve throughput and inline the stat response. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk> Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: Fix build on some gcc versions.Keir Fraser2008-07-241-0/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* minios: grant table map (gntdev) for miniosKeir Fraser2008-07-241-0/+3
| | | | | | | | I've implemented a grant map for mini-os to support the xc_gnttab_*() functions, the equivalent of gntdev in linux. This is useful for my work in putting xenstored in a stub domain. Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
* stubdom: add functions for caml runtimeKeir Fraser2008-07-171-0/+7
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: add stub functions to reduce qemu patchesKeir Fraser2008-07-091-0/+11
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: fix copy/paste typo in select()Keir Fraser2008-07-081-1/+1
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: fix libc-verbose non-lwip compilationKeir Fraser2008-06-301-1/+1
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: permit compilation without lwipKeir Fraser2008-06-091-2/+21
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: Add console reading supportKeir Fraser2008-06-031-3/+22
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: complete libxc supportKeir Fraser2008-05-231-43/+24
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* pvfb/ioemu: transmit refresh interval advice from backend to frontendKeir Fraser2008-05-121-0/+20
| | | | | | which permits the frontend to avoid useless polls. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: sparse application's BSS by linking it separately first, putKeir Fraser2008-04-161-0/+35
| | | | | | | markers at its beginning and end, and then link with mini-os. That permits to stick a bit more to upstream qemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: fix compilationKeir Fraser2008-03-191-1/+0
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: Add support for select() call with NULL arguments.Keir Fraser2008-03-181-6/+26
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Stubdom: add support for file creation.Keir Fraser2008-03-181-2/+20
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: add PVFB supportKeir Fraser2008-02-261-0/+24
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Add stubdomain support. See stubdom/README for usage details.Keir Fraser2008-02-121-0/+1083
- Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in arch_limits.h so as to permit getting them from there without pulling all the internal Mini-OS defines. - Setup a xen-elf cross-compilation environment in stubdom/cross-root - Add a POSIX layer on top of Mini-OS by linking against the newlib C library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c - Cross-compile zlib and libpci too. - Add an xs.h-compatible layer on top of Mini-OS' xenbus. - Cross-compile libxc with an additional xc_minios.c and a few things disabled. - Cross-compile ioemu with an additional block-vbd, but without sound, tpm and other details. A few hacks are needed: - Align ide and scsi buffers at least on sector size to permit direct transmission to the block backend. While we are at it, just page-align it to possibly save a segment. Also, limit the scsi buffer size because of limitations of the block paravirtualization protocol. - Allocate big tables dynamically rather that letting them go to bss: when Mini-OS gets installed in memory, bss is not lazily allocated, and doing so during Mini-OS is unnecessarily trick while we can simply use malloc. - Had to change the Mini-OS compilation somehow, so as to export Mini-OS compilation flags to the Makefiles of libxc and ioemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>