How would I write a virtual CD/DVD burner that would allow programs that burn to write to ISO? - iso

I want to write an app that will allow a program like iTunes which normally will recognize a DVD/CD burner to recognize a virtual one and then write to it creating an ISO. I would guess to use C/C++... can someone point me in the right direction as to how this can be done?
Basically it would be a virtual CD/DVD burner that would output an ISO file to the hard drive. I want to do this for both the usefulness of it as well as the challenge, just need an idea of how to approach it, have no idea how to write virtual hardware.

VMWare has a developer kit for virtual drives. That might be a good place to start.

Related

Simplest way to export data from bare bones OS

What is the simplest way to export data from a bare-bones OS?
I’m developing some assignments for my Computer Architecture course that require students to time different segments of code as accurately as possible. My idea is to insert the code to be timed right into the "Bare Bones"/"Hello World" tutorial from the OSDev wiki (http://wiki.osdev.org/Bare_Bones), which will effectively run the code under test right inside a minimal OS kernel.
This technique works rather well; but, at the moment, my only output option is the VGA text mode. I would like to be able to save the experiment results so the students can analyze/graph the data.
I’m currently installing the “mini-OS” onto a USB flash drive and booting from the flash drive. My original idea was to use BIOS to dump the experiment data back onto the USB drive; but, it looks like calling BIOS routines from protected mode is non-trivial (i.e., requires switching to real or V86 mode).
All I need to do is dump raw binary data somewhere that another machine can read it. I don't need a file system or anything fancy like that. Is there a relatively simple way to access the USB flash drive (or some other external device), or will I need to find/write a complete USB driver or network driver stack? Or, is there a simpler solution?
This post (Real mode BIOS routine and Protected Mode) mentions PwnOS; but the link to the code is broken.
USB drivers are very hard. However, as you mentioned network drivers, you might want to look into serial ports. They are much easier to program than USB.
The osdev wiki should have enough information about this topic.

Changing root password in of Virtual Machine KVM

I was curious as DigitalOcean provide us with root password reset option, as I have been working towards virtualization about 3 months and never came across direct way to do so.
Like openstack offers such option only for xen, where as if I am not wrong Digital Ocean provides for KVM. Also proxmox and other stacks do not provide this option.
So I need to know how these guys managed to do so.
One thing I know is that if I can access the file system then I can edit the shadow file but, In virtual environment Machine is in templete form not in Open File system state.
I was wondering if there is any root backdoor in OS itself provided by DO using which they change password on request ?
Thanks
If you turn off your virtal machine, all you have is the whole "virtual hard drive" file on "real hard drive" in a real machine. It's a common file system that can be parsed and managed from outside with no problem (unless it is encrypted).
So there's no reason for you to NOT be able to access the filesystem of the virtual machine, including the shadow file.
This is typically done using cloudinit... No hackery involved

Balanced processor/SOC (?) for small embedded system running linux

So, I know Linux kernel is quite "heavy" when considering lower scale embedded systems, but currently but we're a 2 man team trying to see how to create our own embedded system.
I'm the one in charge of all software (the other guy is a HW guy), and thus I would like to re-use existing libraries and frameworks as much as possible, and I would like to bounce off some ideas with gurus around here.
I am fairly comfortable in Linux, but the booting and initialization process is new to me, and I need to dive in to that soon enough. Any book recommendations are welcome as well!
I haven't designed any embedded systems before.. Only own some ARM dev boards (beagleboard and raspberry pi).
Current I have prototype of the software running on beagleboard already, and now we're thinking how to minimize the cost, and to create something our own..
It's a system connected to the internet, and I need to run a tiny web server with some scripting support. Performance wise I don't think it needs to be too powerful.
I would like to minimize all bootloader etc work, since I'm a one man SW team, and just concentrate on the application itself.
Of course I understand that I need to configure our kernel for this, but this is indeed why I thought selecting some SoC would be good, since they usually have some linux and bootloaders ready..
First I thought that Cirrus EP9301 would be perfect, since it seems to be a good package, and not very expensive.. But it seems that it's already in end-of-life, and also support for this is very bad (people on the cirrus forums constantly complain about it).
Are there some good choices for this kind of project, which would enable us "easily" to get linux kernel up and running, with still maintaining some kind of decent BOM (hopefully 20USD or so) ?
Your hardware guy should already know this, but go with an existing reference design. Take the raspberry pi, the beagleboard/bone, open-rd, or any number of other existing systems and clone the part you need. As a result the linux porting will be a matter of removing what you are not using from the reference design instead of adding new stuff and hoping it works. If you go with flat pack parts you can do the work in your garage, if you go with bgas you need the equipment for that or pay someone to do it. (can you tell yet that I hate bgas?).
Is linux a requirement, if not that opens the door to a lot more devices using freertos or chibios or a number of other solutions. the stm32f4 discovery board for example is $20, uses what can barely be called a microcontroller for all the features it has (cortex-m4). Supposedly possible to run uclinux on a cortex-m, but definitely possible to run any number of rtoses and have an ip stack, etc. stellaris (ti.com) has a number of eval boards, one/some with ethernet already (use as a reference design). You can also take the wiznet approach (or a spi ethernet) and use any microcontroller (puts you into the avr/msp430 level and price range). Bang for buck the cortex-m's are good, arm based so comfortable to work with, etc.
Using linux if you are already not an experienced at porting to an embedded platform, and dont want to learn that on this go around, I would definitely go with a clone of an existing design, leverage as much as you can from a project with folks that are experienced at porting linux to a platform. If need be take an existing board (beagle/raspi/openrd) and go through the motions of porting to the platform with the cheat sheet of having access to an existing port, see if you cant get uboot ported and linux booting, etc. (dont really need uboot at all, that is possibly an unnecessary complication, just get dram up and pass the atags, etc to linux and just branch to it, pretty easy to launch linux from bare metal).
You could probably do worse than taking the Broadcom BCM2835 - used on the Raspberry Pi - as your starting point - especially if you want to avoid kernel and boot-loader work and a source of reference schematics. If this proves too expensive, check out other devices in the Broadcom range.
A few bits of advice
You probably want some flash rather than a MMC card interface for production use. eMMC is an option. NAND flash is a nightmare due to rapid component obsolescence and the need to get own and dirty with the MTD drivers.
USB Ethernet will be easier to integrate than a controller hanging off a general purpose bus, but won't perform as well. SmSC seems to be popular source for either
You could also have a look at the work that Olimex is doing with their linux boards. Perhaps even order a som and then combine it with other external components.

Programming to different installation types of Ubuntu

I'm studying for a CS degree, and I need to install Ubuntu for a computer systems class. We are going to do low level Assembly optimizations and stuff like that, so they don't want us to install it in a VMware.
Now, I don't want to do a regular dual-boot install, because I've already done it on my previous computer a couple of years ago, and wrecked my hard-disc with the partitioning. Wikipedia says you can use Wubi to boot Ubuntu from ISO, or install it to a flash drive and boot it from there, and then thus remove the need for partitioning.
Now, my question is - how different it is to program for Ubuntu booted from a regular hard-disc partition, from a Wubi ISO, and from an SD card? I guess the programs will work the same on all options, but we're going to do play with low level Assembly optimizations - can I expect to face any difference in that department?
I'm not sure I'd go this route if it were me personally.
You should be fine in terms of whatever bare metal type stuff you want to do -- you're working with memory, the cache, the chip, etc, so your disk drive shouldn't matter (unless you're doing stuff to the filesystem or something).
Where I think you might get annoyed is the logistics of setting up your development environment. Everytime you boot from your USB stick, you're going to need to sudo apt-get GCC, scite, et. al, load your files on into directories that you want, and then get started. That's a hassle. You could optimize this somewhat by creating a custom ISO of your environment using some kind of tool (you might be able to do it with Clonezilla), but still.. yuck.
I would suggest (speaking of Clonezilla) that you snapshot your hard drive, go ahead and install dual booting with Ubuntu, and then you have a backup if anything goes wrong. Or, I'd think you could get by using the school's machines. Don't they have any Linux boxes that you can ssh into, if not use in labs?
Anyway, good luck. :)

building linux kernels

i Just got the book Linux Kernel Development by Robert Love . It has lots of places where you are required to modify and build the kernel . So how should i go with it . Is it better to use a VM , or should i somehow get a proper test machine for it , since i dont want to goof up on my system and data.
A VM has the advantage of offering snapshots. These allow you to save the state of the machine - if the kernel build doesn't work you simply restore the snapshot, and you are able to take as many snapshots as you have disk space to store them. You are also able to clone and re-deploy the VM image, so you have many identical systems to test on.
The same experiment on a physical machine would require far greater effort (ghosting/cloning the disk, re-installing the OS etc).
VirtualBox is free, cross-platform virtualisation software.
There are a lot of tutorials on the web about this topic, e.g. here:
http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html
http://www.kernel.org/pub/linux/kernel/people/gregkh/lkn/lkn_pdf/ch04.pdf
You could do either or both. An alternative somewhere in between is to setup a dual boot. This is a little riskier than a VM, but not too much.
coLinux
or run linux iso image using QEMU on windows

Resources