From 87c1a97d47b3292564fd0cb3a6b46c74a8e2bc7e Mon Sep 17 00:00:00 2001 From: xamidev <121681048+xamidev@users.noreply.github.com> Date: Wed, 22 May 2024 10:33:48 +0200 Subject: [PATCH] Add: working serial port output driver --- .gitignore | 1 + bochslog.txt | 275 -------------------------------------------- com1.out | Bin 0 -> 115 bytes iso/boot/kernel.elf | Bin 10060 -> 9940 bytes kernel.elf | Bin 10060 -> 9940 bytes kmain.c | 5 +- os.iso | Bin 485376 -> 485376 bytes serial.c | 96 ++++++---------- serial.h | 19 +-- 9 files changed, 46 insertions(+), 350 deletions(-) delete mode 100644 bochslog.txt create mode 100644 com1.out diff --git a/.gitignore b/.gitignore index 5761abc..7e92dfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.o +bochslog.txt diff --git a/bochslog.txt b/bochslog.txt deleted file mode 100644 index 4b8de77..0000000 --- a/bochslog.txt +++ /dev/null @@ -1,275 +0,0 @@ -00000000000i[ ] Bochs x86 Emulator 2.7 -00000000000i[ ] Built from SVN snapshot on August 1, 2021 -00000000000i[ ] Timestamp: Sun Aug 1 10:07:00 CEST 2021 -00000000000i[ ] System configuration -00000000000i[ ] processors: 1 (cores=1, HT threads=1) -00000000000i[ ] A20 line support: yes -00000000000i[ ] IPS is set to 1000000 -00000000000i[ ] CPU configuration -00000000000i[ ] SMP support: yes, quantum=16 -00000000000i[ ] level: 6 -00000000000i[ ] APIC support: xapic -00000000000i[ ] FPU support: yes -00000000000i[ ] MMX support: yes -00000000000i[ ] 3dnow! support: yes -00000000000i[ ] SEP support: yes -00000000000i[ ] SIMD support: sse2 -00000000000i[ ] XSAVE support: no -00000000000i[ ] AES support: no -00000000000i[ ] SHA support: no -00000000000i[ ] MOVBE support: no -00000000000i[ ] ADX support: no -00000000000i[ ] x86-64 support: yes -00000000000i[ ] 1G paging support: no -00000000000i[ ] MWAIT support: yes -00000000000i[ ] VMX support: 1 -00000000000i[ ] SVM support: no -00000000000i[ ] Optimization configuration -00000000000i[ ] RepeatSpeedups support: yes -00000000000i[ ] Fast function calls: yes -00000000000i[ ] Handlers Chaining speedups: no -00000000000i[ ] Devices configuration -00000000000i[ ] PCI support: i440FX i430FX i440BX -00000000000i[ ] Network devices support: NE2000 E1000 -00000000000i[ ] Sound support: SB16 ES1370 -00000000000i[ ] USB support: UHCI OHCI EHCI xHCI -00000000000i[ ] VGA extension support: vbe cirrus voodoo -00000000000i[IMG ] Disk image modules -00000000000i[IMG ] flat concat sparse dll growing undoable volatile vpc -00000000000i[IMG ] vmware3 vmware4 vbox vvfat -00000000000i[NETCTL] Networking modules -00000000000i[NETCTL] null vde vnet linux socket tuntap slirp -00000000000i[SNDCTL] Sound drivers -00000000000i[SNDCTL] dummy oss file alsa sdl -00000000000i[USBCTL] Pluggable USB devices -00000000000i[USBCTL] mouse tablet keypad keyboard floppy disk cdrom printer -00000000000i[USBCTL] hub -00000000000i[MEM0 ] allocated memory at 0x7fb8f1ddd010. after alignment, vector=0x7fb8f1dde000 -00000000000i[MEM0 ] 32.00MB -00000000000i[MEM0 ] mem block size = 0x00020000, blocks=256 -00000000000i[MEM0 ] rom at 0xffff0000/65536 ('/usr/share/bochs/BIOS-bochs-legacy') -00000000000i[CPU0 ] WARNING: 3DNow! is not implemented yet ! -00000000000i[DEV ] will paste characters every 100 iodev timer ticks -00000000000i[ ] lt_dlhandle is 0x5638a94a38b0 -00000000000i[PLUGIN] loaded plugin libbx_soundalsa.so -00000000000i[WAVOUT] ALSA: opened default PCM output device -00000000000i[WAVOUT] changed sample rate to 44101 -00000000000i[ ] lt_dlhandle is 0x5638a9c59430 -00000000000i[PLUGIN] loaded plugin libbx_pci.so -00000000000i[ ] lt_dlhandle is 0x5638a94a3990 -00000000000i[PLUGIN] loaded plugin libbx_pci2isa.so -00000000000i[ ] lt_dlhandle is 0x5638a9421ac0 -00000000000i[PLUGIN] loaded plugin libbx_usb_uhci.so -00000000000i[ ] lt_dlhandle is 0x5638a94bdfc0 -00000000000i[PLUGIN] loaded plugin libbx_acpi.so -00000000000i[ ] lt_dlhandle is 0x5638a9420ec0 -00000000000i[PLUGIN] loaded plugin libbx_hpet.so -00000000000i[ ] lt_dlhandle is 0x5638a9c63be0 -00000000000i[PLUGIN] loaded plugin libbx_cmos.so -00000000000i[ ] lt_dlhandle is 0x5638a9c643f0 -00000000000i[PLUGIN] loaded plugin libbx_dma.so -00000000000i[ ] lt_dlhandle is 0x5638a9c64d60 -00000000000i[PLUGIN] loaded plugin libbx_pic.so -00000000000i[ ] lt_dlhandle is 0x5638a9c65520 -00000000000i[PLUGIN] loaded plugin libbx_pit.so -00000000000i[ ] lt_dlhandle is 0x5638a9c65f40 -00000000000i[PLUGIN] loaded plugin libbx_vga.so -00000000000i[ ] lt_dlhandle is 0x5638a9c87580 -00000000000i[PLUGIN] loaded plugin libbx_floppy.so -00000000000i[ ] lt_dlhandle is 0x5638a9c87dc0 -00000000000i[PLUGIN] loaded plugin libbx_ioapic.so -00000000000i[ ] lt_dlhandle is 0x5638a9c885d0 -00000000000i[PLUGIN] loaded plugin libbx_keyboard.so -00000000000i[ ] lt_dlhandle is 0x5638a9c88ed0 -00000000000i[PLUGIN] loaded plugin libbx_harddrv.so -00000000000i[ ] lt_dlhandle is 0x5638a9c8afa0 -00000000000i[PLUGIN] loaded plugin libbx_pci_ide.so -00000000000i[PLUGIN] init_dev of 'pci' plugin device by virtual method -00000000000i[DEV ] i440FX PMC present at device 0, function 0 -00000000000i[PLUGIN] init_dev of 'pci2isa' plugin device by virtual method -00000000000i[DEV ] PIIX3 PCI-to-ISA bridge present at device 1, function 0 -00000000000i[PLUGIN] init_dev of 'cmos' plugin device by virtual method -00000000000i[CMOS ] Using local time for initial clock -00000000000i[CMOS ] Setting initial clock to: Mon May 20 21:48:15 2024 (time0=1716234495) -00000000000i[PLUGIN] init_dev of 'dma' plugin device by virtual method -00000000000i[DMA ] channel 4 used by cascade -00000000000i[PLUGIN] init_dev of 'pic' plugin device by virtual method -00000000000i[PLUGIN] init_dev of 'pit' plugin device by virtual method -00000000000i[PIT ] PIT using realtime synchronisation method -00000000000i[PLUGIN] init_dev of 'vga' plugin device by virtual method -00000000000i[MEM0 ] Register memory access handlers: 0x0000000a0000 - 0x0000000bffff -00000000000i[VGA ] interval=200000, mode=realtime -00000000000i[VGA ] VSYNC using realtime mode -00000000000i[MEM0 ] Register memory access handlers: 0x0000e0000000 - 0x0000e0ffffff -00000000000i[BXVGA ] VBE Bochs Display Extension Enabled -00000000000i[MEM0 ] rom at 0xc0000/38400 ('/usr/share/bochs/VGABIOS-lgpl-latest') -00000000000i[PLUGIN] init_dev of 'floppy' plugin device by virtual method -00000000000i[DMA ] channel 2 used by Floppy Drive -00000000000i[FLOPPY] Using boot sequence cdrom, none, none -00000000000i[FLOPPY] Floppy boot signature check is enabled -00000000000i[PLUGIN] init_dev of 'acpi' plugin device by virtual method -00000000000i[DEV ] ACPI Controller present at device 1, function 3 -00000000000i[PLUGIN] init_dev of 'hpet' plugin device by virtual method -00000000000i[HPET ] initializing HPET -00000000000i[MEM0 ] Register memory access handlers: 0x0000fed00000 - 0x0000fed003ff -00000000000i[PLUGIN] init_dev of 'ioapic' plugin device by virtual method -00000000000i[IOAPIC] initializing I/O APIC -00000000000i[MEM0 ] Register memory access handlers: 0x0000fec00000 - 0x0000fec00fff -00000000000i[IOAPIC] IOAPIC enabled (base address = 0xfec00000) -00000000000i[PLUGIN] init_dev of 'keyboard' plugin device by virtual method -00000000000i[PLUGIN] init_dev of 'harddrv' plugin device by virtual method -00000000000i[HD ] CD on ata0-0: 'os.iso' -00000000000i[CD1 ] load cdrom with path='os.iso' -00000000000i[CD1 ] Opening image file as a cd. -00000000000i[HD ] Media present in CD-ROM drive -00000000000i[HD ] Capacity is 237 sectors (0.46 MB) -00000000000i[PLUGIN] init_dev of 'pci_ide' plugin device by virtual method -00000000000i[DEV ] PIIX3 PCI IDE controller present at device 1, function 1 -00000000000i[PLUGIN] init_dev of 'unmapped' plugin device by virtual method -00000000000i[PLUGIN] init_dev of 'speaker' plugin device by virtual method -00000000000i[PCSPK ] Using lowlevel sound support for output -00000000000i[PLUGIN] init_dev of 'iodebug' plugin device by virtual method -00000000000i[PLUGIN] init_dev of 'parallel' plugin device by virtual method -00000000000i[PAR ] parallel port 1 at 0x0378 irq 7 -00000000000i[PLUGIN] init_dev of 'biosdev' plugin device by virtual method -00000000000i[PLUGIN] init_dev of 'serial' plugin device by virtual method -00000000000i[SER ] com1 at 0x03f8 irq 4 (mode: file) -00000000000i[PLUGIN] init_dev of 'extfpuirq' plugin device by virtual method -00000000000i[PLUGIN] init_dev of 'gameport' plugin device by virtual method -00000000000i[PLUGIN] init_dev of 'usb_uhci' plugin device by virtual method -00000000000i[DEV ] USB UHCI present at device 1, function 2 -00000000000i[UHCI ] USB UHCI initialized -00000000000i[PLUGIN] register state of 'pci' plugin device by virtual method -00000000000i[PLUGIN] register state of 'pci2isa' plugin device by virtual method -00000000000i[PLUGIN] register state of 'cmos' plugin device by virtual method -00000000000i[PLUGIN] register state of 'dma' plugin device by virtual method -00000000000i[PLUGIN] register state of 'pic' plugin device by virtual method -00000000000i[PLUGIN] register state of 'pit' plugin device by virtual method -00000000000i[PLUGIN] register state of 'vga' plugin device by virtual method -00000000000i[PLUGIN] register state of 'floppy' plugin device by virtual method -00000000000i[PLUGIN] register state of 'unmapped' plugin device by virtual method -00000000000i[PLUGIN] register state of 'speaker' plugin device by virtual method -00000000000i[PLUGIN] register state of 'iodebug' plugin device by virtual method -00000000000i[PLUGIN] register state of 'parallel' plugin device by virtual method -00000000000i[PLUGIN] register state of 'biosdev' plugin device by virtual method -00000000000i[PLUGIN] register state of 'serial' plugin device by virtual method -00000000000i[PLUGIN] register state of 'extfpuirq' plugin device by virtual method -00000000000i[PLUGIN] register state of 'gameport' plugin device by virtual method -00000000000i[PLUGIN] register state of 'usb_uhci' plugin device by virtual method -00000000000i[PLUGIN] register state of 'acpi' plugin device by virtual method -00000000000i[PLUGIN] register state of 'hpet' plugin device by virtual method -00000000000i[PLUGIN] register state of 'ioapic' plugin device by virtual method -00000000000i[PLUGIN] register state of 'keyboard' plugin device by virtual method -00000000000i[PLUGIN] register state of 'harddrv' plugin device by virtual method -00000000000i[PLUGIN] register state of 'pci_ide' plugin device by virtual method -00000000000i[SYS ] bx_pc_system_c::Reset(HARDWARE) called -00000000000i[CPU0 ] cpu hardware reset -00000000000i[APIC0 ] allocate APIC id=0 (MMIO enabled) to 0x0000fee00000 -00000000000i[CPU0 ] CPU[0] is the bootstrap processor -00000000000i[CPU0 ] CPUID[0x00000000]: 00000005 68747541 444d4163 69746e65 -00000000000i[CPU0 ] CPUID[0x00000001]: 00000633 00010800 00002028 17cbfbff -00000000000i[CPU0 ] CPUID[0x00000002]: 00000000 00000000 00000000 00000000 -00000000000i[CPU0 ] CPUID[0x00000003]: 00000000 00000000 00000000 00000000 -00000000000i[CPU0 ] CPUID[0x00000004]: 00000000 00000000 00000000 00000000 -00000000000i[CPU0 ] CPUID[0x00000005]: 00000040 00000040 00000003 00000020 -00000000000i[CPU0 ] CPUID[0x80000000]: 80000008 68747541 444d4163 69746e65 -00000000000i[CPU0 ] CPUID[0x80000001]: 00000633 00000000 00000101 ebd3f3ff -00000000000i[CPU0 ] CPUID[0x80000002]: 20444d41 6c687441 74286e6f 7020296d -00000000000i[CPU0 ] CPUID[0x80000003]: 65636f72 726f7373 00000000 00000000 -00000000000i[CPU0 ] CPUID[0x80000004]: 00000000 00000000 00000000 00000000 -00000000000i[CPU0 ] CPUID[0x80000005]: 01ff01ff 01ff01ff 40020140 40020140 -00000000000i[CPU0 ] CPUID[0x80000006]: 00000000 42004200 02008140 00000000 -00000000000i[CPU0 ] CPUID[0x80000007]: 00000000 00000000 00000000 00000000 -00000000000i[CPU0 ] CPUID[0x80000008]: 00003028 00000000 00000000 00000000 -00000000000i[CPU0 ] CPU Features supported: -00000000000i[CPU0 ] x87 -00000000000i[CPU0 ] 486ni -00000000000i[CPU0 ] pentium_ni -00000000000i[CPU0 ] p6ni -00000000000i[CPU0 ] mmx -00000000000i[CPU0 ] 3dnow! -00000000000i[CPU0 ] debugext -00000000000i[CPU0 ] vme -00000000000i[CPU0 ] pse -00000000000i[CPU0 ] pae -00000000000i[CPU0 ] pge -00000000000i[CPU0 ] pse36 -00000000000i[CPU0 ] mtrr -00000000000i[CPU0 ] pat -00000000000i[CPU0 ] sysenter_sysexit -00000000000i[CPU0 ] clflush -00000000000i[CPU0 ] sse -00000000000i[CPU0 ] sse2 -00000000000i[CPU0 ] mwait -00000000000i[CPU0 ] vmx -00000000000i[CPU0 ] longmode -00000000000i[CPU0 ] lm_lahf_sahf -00000000000i[CPU0 ] nx -00000000000i[CPU0 ] cmpxhg16b -00000000000i[CPU0 ] rdtscp -00000000000i[CPU0 ] ffxsr -00000000000i[CPU0 ] xapic -00000000000i[PLUGIN] reset of 'pci' plugin device by virtual method -00000000000i[PLUGIN] reset of 'pci2isa' plugin device by virtual method -00000000000i[PLUGIN] reset of 'cmos' plugin device by virtual method -00000000000i[PLUGIN] reset of 'dma' plugin device by virtual method -00000000000i[PLUGIN] reset of 'pic' plugin device by virtual method -00000000000i[PLUGIN] reset of 'pit' plugin device by virtual method -00000000000i[PLUGIN] reset of 'vga' plugin device by virtual method -00000000000i[PLUGIN] reset of 'floppy' plugin device by virtual method -00000000000i[PLUGIN] reset of 'acpi' plugin device by virtual method -00000000000i[PLUGIN] reset of 'hpet' plugin device by virtual method -00000000000i[PLUGIN] reset of 'ioapic' plugin device by virtual method -00000000000i[PLUGIN] reset of 'keyboard' plugin device by virtual method -00000000000i[PLUGIN] reset of 'harddrv' plugin device by virtual method -00000000000i[PLUGIN] reset of 'pci_ide' plugin device by virtual method -00000000000i[PLUGIN] reset of 'unmapped' plugin device by virtual method -00000000000i[PLUGIN] reset of 'speaker' plugin device by virtual method -00000000000i[PLUGIN] reset of 'iodebug' plugin device by virtual method -00000000000i[PLUGIN] reset of 'parallel' plugin device by virtual method -00000000000i[PLUGIN] reset of 'biosdev' plugin device by virtual method -00000000000i[PLUGIN] reset of 'serial' plugin device by virtual method -00000000000i[PLUGIN] reset of 'extfpuirq' plugin device by virtual method -00000000000i[PLUGIN] reset of 'gameport' plugin device by virtual method -00000000000i[PLUGIN] reset of 'usb_uhci' plugin device by virtual method -00000000000i[ ] set SIGINT handler to bx_debug_ctrlc_handler -00000004662i[BIOS ] $Revision: 14314 $ $Date: 2021-07-14 18:10:19 +0200 (Mi, 14. Jul 2021) $ -00000317288i[KBD ] reset-disable command received -00000318445i[PIDE ] BAR #4: i/o base address = 0xc000 -00000318672i[UHCI ] BAR #4: i/o base address = 0xc100 -00000324507i[P2ISA ] PCI IRQ routing: PIRQD# set to 0x0b -00000324523i[P2ISA ] write: ELCR2 = 0x08 -00000324543i[UHCI ] new IRQ line = 11 -00000324608i[P2ISA ] PCI IRQ routing: PIRQA# set to 0x0a -00000324624i[P2ISA ] write: ELCR2 = 0x0c -00000324644i[ACPI ] new IRQ line = 10 -00000442944i[VBIOS ] VGABios $Id: vgabios.c 288 2021-05-28 19:05:28Z vruppert $ -00000443015i[BXVGA ] VBE known Display Interface b0c0 -00000443047i[BXVGA ] VBE known Display Interface b0c5 -00000445690i[VBIOS ] VBE Bios $Id: vbe.c 292 2021-06-03 12:24:22Z vruppert $ -00004097906i[BIOS ] IDE time out -00685117203i[BIOS ] Booting from 07c0:0000 -00685212587i[BIOS ] int13_harddisk: function 41, unmapped device for ELDL=80 -00685216258i[BIOS ] int13_harddisk: function 08, unmapped device for ELDL=80 -00685219929i[BIOS ] *** int 15h function AX=00c0, BX=0000 not yet supported! -00867137284i[ ] Ctrl-C detected in signal handler. -00867137285i[ ] dbg: Quit -00867137285i[CPU0 ] CPU is in protected mode (active) -00867137285i[CPU0 ] CS.mode = 32 bit -00867137285i[CPU0 ] SS.mode = 32 bit -00867137285i[CPU0 ] EFER = 0x00000000 -00867137285i[CPU0 ] | EAX=0000002a EBX=0002cd80 ECX=000000f0 EDX=00000006 -00867137285i[CPU0 ] | ESP=00067ecc EBP=00067ee0 ESI=0002ced8 EDI=0002ced9 -00867137285i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf zf af pf cf -00867137285i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D -00867137285i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 ffffffff 1 1 -00867137285i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 ffffffff 1 1 -00867137285i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 ffffffff 1 1 -00867137285i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 ffffffff 1 1 -00867137285i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 ffffffff 1 1 -00867137285i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 ffffffff 1 1 -00867137285i[CPU0 ] | EIP=001006cb (001006cb) -00867137285i[CPU0 ] | CR0=0x60000011 CR2=0x00000000 -00867137285i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 -00867137285i[CMOS ] Last time is 1716235362 (Mon May 20 22:02:42 2024) -00867137285i[SIM ] quit_sim called with exit code 0 diff --git a/com1.out b/com1.out new file mode 100644 index 0000000000000000000000000000000000000000..a59a74111c79f742c252ef707b646abbdf59c772 GIT binary patch literal 115 zcmYL>!3~5k3E*!-gB1?1-2Wz1si^D@|Fipef?VYQY^uOuq2P1|jn*aa+ literal 0 HcmV?d00001 diff --git a/iso/boot/kernel.elf b/iso/boot/kernel.elf index db82abfcc5cf29e81be5a5ea4751021849c802b7..997ad61e0acb688277d4a6a07b2bdf6cdf6e6282 100755 GIT binary patch delta 1753 zcmZ8he@q)?7=G{CYfCBgU>$`H<$!i%b0I_*6SHNGg(~V;nmLj=H%Wn;2b7kzhm80~ zZR&7@kQ6_4e=PnQCMHXqSy*s0W+T=~FzB{~E&OFz=FBOLLsJn(=lOnjEi^XJ@1Ey< zp7(vf_dS?BFxQeOw}P36od7WF9;>P0nhOA$FTQZi?q4tg#F8s^0A(iw5Kq}gM!c4hW0{#`>+t=T<0*$Sq-Fky9OB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WyAcprO<3b=Bs~4ism`pU0R?n6Vi}I0hg8;iD zLNLBqTbC3?fsA^bB{^AhJe&|9mQ2)$Nexq_Et{(XscEHRYZ{`i7h@#YK}!*HRKGH**&-a)Gp9ZXBP+ eF?X1JR6c^ry^njij2qxvauT0D_X502RsR7dL|cFW diff --git a/kmain.c b/kmain.c index b808037..273b1d1 100644 --- a/kmain.c +++ b/kmain.c @@ -5,6 +5,9 @@ int kmain(int retvalue) { clear(); puts("hello\nbrave\nnew\nworld"); - serial_write("hello", 1); + + init_serial(); + serial_puts("Hello, brave new world. This is a message to let you know that the kernel has started.\n"); + serial_puts("This is a second message.\n"); return retvalue; } diff --git a/os.iso b/os.iso index eee9753aeedec904939dbf20a4615d612a7e68e4..d99faa02ff2d70905473d60550efea091b3b001c 100644 GIT binary patch delta 2130 zcmZ8ieQZ-z6u@3YAUxdTjpejx42I#pkOB~R5iTq&EKER2VBGraC#|5jDJqu-H6 zt3b}#X_*?1CX3_;qW$X%lj$b32`SH}p@q~g98!}7-WW)(k&$Svn^~hf7)jKKIMia{ zNF#KXtqH6eR9egkyggV>Ta3r$s^J-2H&d$nV7PafnG-S~y&082$?JurpamDO>r)U~ zfBxkbeA#5btwX3eJZ3^jE@2SzMUDG?w$WJ3CjY4c_`O-)t&P*7LSJMRS`qds%vUPY zYUNsYOb&$0_T78k7fqM_O6KEaOFJ%PE|bP~oV)gC9!iIl#mR%Rh1n@xt>u|;ET_LCW-ym51?t{b{Jz9R7}2j^JCmK@5(2#CQ}J zkr$8R9G#C6gzP+upZ03y4S<@%6*K5uxGE%$(}s`4VlfyOFk%zTTAZMye~PTqh+~wI zrkQx4W17*ZQMM^Yyhc+!rh&`jq!&ug5GN_McuH6Gl*(jHF=7{uR7&CmX;kr(f0a&G zbV>RPuyS-iOWlW(^QP*&06a>}9@eRqw}X`3V?e3&9TA^E{e5A%hx~jDXL-}*CE#ri zuQ5Q7m20t%w8`h7>PLOjKc-&mNMf@}JG;~hNt>M`KY(hi2BNQ7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_RIkZ zxq@q)(~x3@QU5cpotPK-9QlLb=a6WU0Xg{-3DOk7UBt&y1Y?LtvB6|Rb8xgTA^%g1 zGlML|Mc6PKHN!fFK|}5&@KVHq@dkmc<ttENPLC*p-Tq3a2}3-KPT$KD}U|1jcXDGm0OV1WIau!qgzYs89_kq#hc8TS6O z0+$f4r~O@UG}}ySEiSvsVchJjvD&wIToz-sv&vFUwtC#Pbk|8(Q#_5}u-90~W{1V( znl3hbtX2yhJ_*{{30> 8) & 0x00FF); - outb(SERIAL_DATA_PORT(com), divisor & 0x00FF); -} + outb(PORT+1, 0x00); + outb(PORT+3, 0x80); + outb(PORT+0, 0x03); + outb(PORT+1, 0x00); -void serial_configure_line(unsigned short com) -{ - /* - d b p s dl - 0 0 000 0 11 = 0x03 - - Length 8 bits, no parity bit, one stop bit, break control off - */ + outb(PORT+3, 0x03); + outb(PORT+2, 0xC7); + outb(PORT+4, 0x0B); + outb(PORT+4, 0x1E); + outb(PORT+0, 0xAE); - outb(SERIAL_LINE_CMD_PORT(com), 0x03); -} - -void serial_configure_buffer(unsigned short com) -{ - /* - lv b r d c c e - 11 0 0 0 1 1 1 = 0xC7 - - Enable FIFO, clear FIFO queues, use 14 bytes as queue size - */ - - outb(SERIAL_LINE_CMD_PORT(com), 0xC7); -} - -void serial_configure_modem(unsigned short com) -{ - /* - - r r a l a a r d - 0 0 0 0 0 0 1 1 = 0x03 - - Ready to transmit, data terminal ready - */ - - outb(SERIAL_LINE_CMD_PORT(com), 0x03); -} - -int serial_is_transmit_fifo_empty(unsigned short com) -{ - return (inb(SERIAL_LINE_STATUS_PORT(com)) & 0x20); -} - -void serial_write(const char* buf, unsigned short com) -{ - serial_configure_baud_rate(com, 2); - serial_configure_line(com); - serial_configure_buffer(com); - serial_configure_modem(com); - - for (unsigned int i = 0; i