diff options
author | Marcel Ritter <unrzl1@linux.rrze.uni-erlangen.de> | 2009-10-20 10:47:25 +0200 |
---|---|---|
committer | Marcel Ritter <unrzl1@linux.rrze.uni-erlangen.de> | 2009-10-20 10:47:25 +0200 |
commit | ef041926f4a55fc4d52bf7814791395435165cf9 (patch) | |
tree | 93b0c01e85c78917c088a849190bb6a27f0159e7 /com32/lua | |
parent | 63de251097b823131f00304c1cb91662e0e81e31 (diff) | |
download | syslinux-ef041926f4a55fc4d52bf7814791395435165cf9.tar.gz |
New
Diffstat (limited to 'com32/lua')
-rw-r--r-- | com32/lua/doc/syslinux.asc | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/com32/lua/doc/syslinux.asc b/com32/lua/doc/syslinux.asc new file mode 100644 index 00000000..413565bf --- /dev/null +++ b/com32/lua/doc/syslinux.asc @@ -0,0 +1,216 @@ +Syslinux LUA User Guide +======================= +Marcel Ritter <Marcel.Ritter@rrze.uni-erlangen.de> + +Modules +------- + +SYSLINUX +~~~~~~~~ + +.syslinux.sleep(ms) + +Sleep for +ms+ milliseconds + +.run_command(command) + +Execute syslinux command line +command+. + +_Example_: +...................................................... + syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") +...................................................... + +.run_default() + +FIXME + +.local_boot() + +FIXME + +.final_cleanup() + +FIXME + +.boot_linux(kernel, cmdline, [mem_limit], [videomode]) + +FIXME + +.run_kernel_image(kernel, cmdline, ipappend_flags, type) + +FIXME + +.loadfile(filname) + +Load file +filename+ (via TFTP) + +.filesize(file) + +Return size of +file+ (loaded by loadfile()) + +.filename(file) + +Return name of +file+ (loaded by loadfile()) + +.in itramfs_init() + +Return empty initramfs object + +.initramfs_load_archive(initramfs, filename) + +Load contents of +filename+ into +initramfs+. Initialize ++initramfs+ with initramfs_init() before use. + +.initramfs_add_file(initramfs, file) + +Adds +file+ to +initramfs+. +initramfs+ needs to be +initialized, +file+ has been loaded by loadfile(). + +_Example_: +...................................................... + -- get nice output + printf = function(s,...) + return io.write(s:format(...)) + end -- function + + kernel = syslinux.loadfile("/SuSE-11.1/x86_64/linux") + + printf("Filename/size: %s %d\n", syslinux.filename(kernel), syslinux.filesize(kernel)) + + initrd = syslinux.loadfile("/SuSE-11.1/x86_64/initrd") + + printf("Filename/size: %s %d\n", syslinux.filename(initrd), syslinux.filesize(initrd)) + + initrd = syslinux.initramfs_init() + syslinux.initramfs_load_archive(initrd, "/SuSE-11.1/x86_64/initrd"); + + syslinux.boot_it(kernel, initrd, "init=/bin/bash") + + syslinux.sleep(20000) + +...................................................... + + + +DMI +~~~ + +.dmi_supported() + +Returns +true+ if DMI is supported on machine, +false+ otherwise. + +.dmi_gettable() + +Returns a list if key-value pairs. The key is one of the DMI property strings: +FIXME list + +_Example_: +...................................................... + if (dmi.supported()) then + + dmitable = dmi.gettable() + + for k,v in pairs(dmitable) do + print(k, v) + end + + print(dmitable["system.manufacturer"]) + print(dmitable["system.product_name"]) + print(dmitable["bios.bios_revision"]) + + if ( string.match(dmitable["system.product_name"], "ESPRIMO P7935") ) then + print("Matches") + syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") + else + print("Does not match") + syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") + end + + end + +...................................................... + + +PCI +~~~ + +.pci_getinfo() + +.pci_getidlist() + + +VESA +~~~~ + +.getmodes() + +Return list of available VESA modes. + +_Example_: +...................................................... + -- get nice output + printf = function(s,...) + return io.write(s:format(...)) + end + + -- list available vesa modes + -- only one supported right now, not of much use + modes = vesa.getmodes() + + for mind,mode in pairs(modes) do + printf("%04x: %dx%dx%d\n", mode['mode'], mode['hres'], mode['vres'], mode['bpp']) + end +...................................................... + + +.setmode() + +Set (only currently supported) VESA mode. + +.load_background(filename) + +Load +filename+ from TFTP, and use it as background image. + +_Example_: +...................................................... + -- get nice output + printf = function(s,...) + return io.write(s:format(...)) + end + + -- lets go to graphics land + vesa.setmode() + + printf("Hello World! - VESA mode") + + -- some text to display "typing style" + textline=[[ + From syslinux GSOC 2009 home page: + + Finish the Lua engine + + We already have a Lua interpreter integrated with the Syslinux build. However, right now it is not very useful. We need to create a set of bindings to the Syslinux functionality, and have an array of documentation and examples so users can use them. + + This is not a documentation project, but the documentation deliverable will be particularly important for this one, since the intended target is system administrators, not developers. + ]] + + + -- do display loop + -- keep in mind: background change will not erase text! + while ( true ) do + + vesa.load_background("/background1.jpg") + + syslinux.sleep(1000) + + for i = 1, #textline do + local c = textline:sub(i,i) + printf("%s", c) + syslinux.sleep(200) + end + + syslinux.sleep(10000) + +...................................................... + |