自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

驚動大神的JavaScript:在Web上運(yùn)行Linux

開發(fā) 前端
一個(gè)叫Fabrice Bellard的程序員寫了一段Javascript在Web瀏覽器中啟動Linux(原網(wǎng)頁,我把這個(gè)網(wǎng)頁iframe在了下面),目前,你只能使用Firefox 4和Chrome 11運(yùn)行這個(gè)Linux。

一個(gè)叫Fabrice Bellard的程序員寫了一段Javascript在Web瀏覽器中啟動Linux(原網(wǎng)頁,我把這個(gè)網(wǎng)頁iframe在了下面),目前,你只能使用Firefox 4和Chrome 11運(yùn)行這個(gè)Linux。這不是什么假的模仿Linux的東西,這是實(shí)實(shí)在在的運(yùn)行一個(gè)Linux。這一舉動還引起了很多很牛人的關(guān)注,包括Javascript的創(chuàng)建者Brendan Eich。

  1.  
  2. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                    
  3. TCP established hash table entries: 1024 (order: 0, 4096 bytes)                   
  4. TCP bind hash table entries: 512 (order: -1, 2048 bytes)                          
  5. TCP: Hash tables configured (established 1024 bind 512)                           
  6. TCP reno registered                                                               
  7. checking if image is initramfs...it isn't (bad gzip magic numbers); looks like a  
  8. n initrd                                                                          
  9. Freeing initrd memory: 2048k freed                                                
  10. Total HugeTLB memory allocated, 0                                                 
  11. io scheduler noop registered                                                      
  12. io scheduler anticipatory registered                                              
  13. io scheduler deadline registered                                                  
  14. io scheduler cfq registered (default)                                             
  15. Real Time Clock Driver v1.12ac                                                    
  16. JS clipboard: I/O at 0x03c0                                                       
  17. Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled         
  18. serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16450                               
  19. RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize             
  20. loop: loaded (max 8 devices)                                                      
  21. TCP cubic registered                                                              
  22. NET: Registered protocol family 1                                                 
  23. NET: Registered protocol family 17                                                
  24. Using IPI Shortcut mode                                                           
  25. Time: pit clocksource has been installed.                                         
  26. RAMDISK: ext2 filesystem found at block 0                                         
  27. RAMDISK: Loading 2048KiB [1 disk] into ram disk... done.                          
  28. VFS: Mounted root (ext2 filesystem).                                              
  29. Freeing unused kernel memory: 124k freed                                          
  30. W  
  31. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                    
  32. TCP established hash table entries: 1024 (order: 0, 4096 bytes)                   
  33. TCP bind hash table entries: 512 (order: -1, 2048 bytes)                          
  34. TCP: Hash tables configured (established 1024 bind 512)                           
  35. TCP reno registered                                                               
  36. checking if image is initramfs...it isn't (bad gzip magic numbers); looks like a  
  37. n initrd                                                                          
  38. Freeing initrd memory: 2048k freed                                                
  39. Total HugeTLB memory allocated, 0                                                 
  40. io scheduler noop registered                                                      
  41. io scheduler anticipatory registered                                              
  42. io scheduler deadline registered                                                  
  43. io scheduler cfq registered (default)                                             
  44. Real Time Clock Driver v1.12ac                                                    
  45. JS clipboard: I/O at 0x03c0                                                       
  46. Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled         
  47. serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16450                               
  48. RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize             
  49. loop: loaded (max 8 devices)                                                      
  50. TCP cubic registered                                                              
  51. NET: Registered protocol family 1                                                 
  52. NET: Registered protocol family 17                                                
  53. Using IPI Shortcut mode                                                           
  54. Time: pit clocksource has been installed.                                         
  55. RAMDISK: ext2 filesystem found at block 0                                         
  56. RAMDISK: Loading 2048KiB [1 disk] into ram disk... done.                          
  57. VFS: Mounted root (ext2 filesystem).                                              
  58. Freeing unused kernel memory: 124k freed                                          
  59. Welcome to JS/Linux  

隨后,F(xiàn)abrice Bellard發(fā)布了相關(guān)的技術(shù)說明:http://bellard.org/jslinux/tech.html,從這份文檔中我們可以看到:

這個(gè)模似器完全由Javascript寫成

CPU仿真器使用的是QEMU(接近于原古的486),為了裝上Linux,其做了一些改動。

Javascript的終端本來可以使用termlib,但他還是自己寫了一個(gè),因?yàn)镺S的按鍵和Web瀏覽器不一樣(here)

Linux 使用了2.6.20內(nèi)核,編譯配置在這里,并做了一些小改動。

磁盤用的是Ram Disk,在啟動的時(shí)候裝載。其文件系統(tǒng)由Buildroot 和BusyBox產(chǎn)生。

在Home目錄下有一個(gè)hello.c的程序,你可以使用TinyCC編譯(tcc,參看酷殼的這篇文章)

從這個(gè)事我有這些感觸,

在Web上運(yùn)行一個(gè)Linux的操作系統(tǒng)不是問題。那么在Web上還有什么不能做的嗎?

Linux真是性能很高,在Javascript下運(yùn)行感覺也不慢啊。

真是Techno-Geek。

原文鏈接:http://coolshell.cn/articles/4722.html#more-4722

【編輯推薦】

  1. 19個(gè)很有用的JavaScript庫強(qiáng)烈推薦
  2. 15款超棒的JavaScript開發(fā)工具推薦
  3. 從零開始學(xué)習(xí)jQuery之你必須知道的JavaScript
  4. 高性能WEB開發(fā)之如何加載JavaScript
  5. 泄露你的JavaScript技術(shù)很爛的五個(gè)表現(xiàn)
責(zé)任編輯:陳貽新 來源: 酷殼
相關(guān)推薦

2011-03-25 11:21:36

NagiosLinux

2020-06-11 14:33:10

MacBookLinux軟件

2010-11-17 09:29:31

linux Fedora 13Ubuntu 10.0

2016-02-16 09:36:37

CrossOverLinuxWindows

2020-06-01 16:25:43

WindowsLinux命令

2022-06-30 13:54:16

BottlesLinuxWindows

2021-11-23 09:20:25

Wine 6.22LinuxWindows

2013-07-02 10:52:42

SUSELinuxWindows Azu

2013-07-02 11:34:46

SUSELinuxWindows Azu

2022-01-18 17:57:21

PodmanLinux容器

2009-06-27 21:35:50

Linux服務(wù)器

2015-10-14 10:02:33

ClojureScri Android

2023-01-26 11:56:31

Kubernete虛擬機(jī)k3s

2011-02-16 09:06:51

SUSE LinuxIBMWatson

2021-03-09 11:09:10

LinuxWindows應(yīng)用程序

2023-04-12 15:37:31

Linux系統(tǒng)CPU

2020-02-05 08:00:00

LinuxMacOSWindows

2022-06-23 09:55:56

WineZGUILinux 桌面Windows 應(yīng)用

2019-10-09 16:50:48

SSHLinux遠(yuǎn)程系統(tǒng)

2021-12-14 16:15:47

LinuxNginxWeb
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號