Xathrya Sabertooth |
Set Up Environment for Firefox OS Development – Firefox OS Simulator Posted: 29 Sep 2013 01:34 AM PDT Firefox OS is a smartphone and table Operating System developed by Mozilla. It is developed under the same brand of Mozilla’s famous web browser project, Mozilla Firefox. Mozilla has a big and clear vision. Firefox OS is developed to adapt the dynamic of the web. It anticipates users needs, adapts to every situation, and instantly delivers information user want. The interesting part is, Mozilla has develop an add-on for developing and simulating Firefox OS on top of Firefox browser. This article will discuss about how can we prepare a portable development environment and simulating Firefox OS. About Firefox OS SimulatorLike implied by the name, Firefox OS simulator is a simulator for Firefox OS. As per September 29th 2013, the current Firefox OS Simulator is still at an early stage of development. Thus, it isn’t yet as reliable and complete. Mozilla also encourage to report bug to GitHub and participate to the development process. The big concept Firefox OS has is an add-on for Firefox browser. Using this add-on we can test and debug Firefox OS app on the desktop. It is like Android Emulator, but lightweight and easy to use. But, as told above, don’t expect too much for now. But still, it’s quite promising So, what’s bundled to this add-on?
Installing and Running the SimulatorInstalling the simulator is really easy. As easy as installing any other Firefox add-on.
The add-on is quite big in size, thus Firefox may freeze for several seconds while installing it. A dialog titled “Warning: Unresponsive script” might appear. If it does, just click “Continue” to wait for installation to finish. The Dashboard opens automatically when you install the Simulator. You can reopen it at any time by going to the “Firefox” menu (or “Tools”), then “Web Developer”, then “Firefox OS Simulator”. And here is the Dashboard for you: Here, on the left panel is a button to activate the simulator. The right panel will list all application you have developed and can be run on top of Firefox OS (simulator). Managing AppsAdding appsTo add a packaged app to the Simulator, open the Dashboard, click “Add Directory” and select the manifest file for your app. To add a hosted app, enter a URL in the textbox where it says “URL for page or manifest.webapp”, then click “Add URL”. If the URL points to a manifest, then that manifest will be used. If it doesn’t, the Dashboard will generate a manifest for the URL: so you can add any website as an app just by entering its URL. When you add an app, the Dashboard will run a series of tests on your manifest file, checking for common problems. See the section on Manifest Validation for details on what tests are run. Unless manifest validation reveals that your app has errors, the Dashboard will then automatically run your app in the Simulator. On each entry, you will see information about the app:
You also got four commands:
The Simulator DeviceHere is what the simulator looks like. The simulator device will be opened on new Firefox window. The simulator can be started in two different ways:
The simulator appear as window 320×480 pixels with a tool bar at the bottom and a menubar at the top that contains some extra features: You can left-click on Firefox OS area to simulate touch events. To simulate drag, click and hold the button to your preferred area. Here is the example. The left is the default launcher and drag to right will bring you to menu. Now we have seen toolbar. Let’s play around with it. There are three buttons on toolbar. From left to right, these are: Home button, Screen Rotation button, and the Geolocation button.
Developer ToolsYou can attach developer tools to the Simulator, to help debug your app. At the moment you can only attach the JavaScript Debugger, the Web Console, the Style Editor, the Profiler and the Network Monitor. Mozilla promise bringing more support of developer tools. To attach developer tools to the Simulator, click the “Connect” button for an app. The Dashboard will then open a developer toolbox pane at the bottom of the Dashboard tab and connect it to the app: Web ConsoleThe app can log to this console using the global console object, and it displays various other messages generated by the app: network requests, CSS and JS warnings/errors, and security errors. DebuggerUsing the Debugger, you can step through JavaScript code that is running in the connected app, manage breakpoints, and watch expressions to track down errors and problems faster. Style EditorYou can view and edit CSS files referenced in the app using the connected Style Editor. Your changes will be applied to the app in real time, without needing to refresh the app. ProfilerUsing the Profiler tool connected to the app, you can to find out where your JavaScript code is spending too much time. The Profiler periodically samples the current JavaScript call stack and compiles statistics about the samples. Network MonitorThanks to the new Network Monitor, you can analyze the status, headers, content and timing of all the network requests initiated by the app through a friendly interface. |
Introduction to User-Mode Linux Posted: 28 Sep 2013 12:00 PM PDT User-Mode Linux is a safe, secure way of running Linux versions and Linux processes. It is a virtualization, but use different approach in compare to VirtualBox or VMWare. Run buggy software, experiment with new Linux kernels or distributions, and poke around in the internals of Linux, all without risking main Linux. This article will give a brief introduction to User-Mode Linux and test what we can do with it. Comparing User-Mode Linux with Other Virtualization TechnologyUML (User-Mode Linux) differs from other virtualization technologies in being more of a virtual operating system (OS) rather than a virtual machine. Things like VMWare are virtual machine which emulate a physical platform from the CPU to the peripherals. In contrast, UML can be only a Linux guest. However, being a virtualOS allows UML to interact more fully with the host OS. Other virtualization technologies such as Xen, BSD jail, Solaris zones, and chroot are integrated into the host OS, as opposed to UML, which runs in a process. This gives UML the advantage of being independent from the host OS version, at the cost of some performance. However, a lot (maybe all) of this performance can be regained without losing the flexibility and manageability that UML gains from being in userspace. The benefit of virtualization accrue largely from the degree of isolation between users and processes inside the virtual machine or jail and those outside it. The least complete virtualization is provided by chroot which only jails processes into a directory. In all other respects, the processes are unconfined. Even then, on Linux, chroot can't confine a process with root privileges, since its design allows superuser processes to escape. Finally, technologies such as VMWare, Xen, and UML implement full virtualization and isolation. They all have fully virtualized devices with no restrictions on how they may be used. They also confine their processes with respect to CPU consumption by virtue of having a certain number of virtual processors they may use. They also all run separate instances of the OS, which may be different versions (and even a completely different OS in the case of VMWare) than the host. The User-Mode LinuxUser-Mode Linux is an ELF binary which run on userspace. It is like other process. However, the process itself is a modified copy of Linux kernel. Therefore, we can say that UML is a kernel and userspace program at same time (but it has different perspective). You can obtain the kernel here: http://uml.devloop.org.uk/ That links provide a kernel up to the recent version. The older kernel is available. All are available in 32-bit and 64-bit architecture. Also, you can download a filesystem on here: http://fs.devloop.org.uk/ The disk image are a companion for Kernel. It is optional, though recommended to be obtained. For this article, I will use Kernel version 3.11.2 64-bit and file system Slackware 12.x 64-bit. First BootExtract the kernel and filesystem. Here I have:
Let’s head to kernel first. Check and run the kernel: chmod +x kernel64-3.11.2 ./kernel64-3.11.2 mem=512M As told by above command, I run kernel and having virtual RAM about 512MB. Don’t worry if you encounter a kernel panic. It’s fair to assume that we didn’t specify any root filesystem (and that’s right). Complete Boot UMLNow, after the first attempt, let’s boot UML in proper way. This time, we will boot kernel and specify a filesystem. The filesystem we use here is Slamd64-12.1-root_fs. ./kernel64-3.11.2 ubda=Slamd64-12.1-root_fs mem=512M Now you can see the familiar login prompt on your terminal. Add a Network SupportTo add network capability to UML machine, we have to create a new TAP interface. We should allocate the TAP device to UML instance. Here, on you host Linux: tunctl -t tap0 tap0 is the device name for our new interface. Next, assign an IP address to it, assuming the IP address is 192.168.1.3 and on 192.168.1.0/24 network. Of course you need to adjust it to your network. ifconfig tap0 192.168.1.3 Then modify the kernel invocation, by: ./kernel64-3.11.2 ubda=Slamd64-12.1-root_fs mem=512M eth0=tuntap,tap0,MAC_ADDR,IP_ADDR con0=fd:0,fd:1 |
You are subscribed to email updates from Xathrya Sabertooth To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Tidak ada komentar:
Posting Komentar